-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make watch (air) concurrent process problem #24845
Comments
Have not seen above but have seen two other related issues:
|
I do not see there is any problem. Although I do not use
I do not think so. The backend code already supports hot-reloading the templates which is more convince and faster than completely restarting the Gitea process. |
On this topic, I think we can try |
It definitely happens to me a lot that I have to restart the go server because templates do not rebuild after an error was fixed. I'm not sure what exact sequence of actions triggers it yet. It is unrelated to air and should be reproducible just with the go server in dev mode. |
I can imagine a case for your problem: if the go code and tmpl code are changed at the same time, tmpl has errors, then air will restart the Gitea process, but Gitea will report fatal errors when it encounters template error during it's startup. So, the Gitea process just exits due to your template errors. Then if you only fix the template errors, air doesn't see go file change, air won't start a new Gitea process. It could be fixed by make Gitea keep running in dev mode even if there is template error during startup. |
-> Improve RunMode / dev mode #24886 |
Yes, it sounds likely that I've hit that scenario, not 100% sure because most of the time, I actually don't edit go code, just templates and css/js. |
1. non-dev mode is treated as prod mode, to protect users from accidentally running in dev mode if there is a typo in this value. 2. in dev mode, do not need to really exit if there are template errors, because the template errors could be fixed by developer soon and the templates get reloaded, help: * #24845 (comment) 3. Fine tune the mail template loading message.
Regarding original issue: I think it's an air bug. Maybe we can kill off any old processes when starting new ones. Air also has this option, not sure it would help. |
I reproduced this double build and double run just now after switching branches while air was running:
|
I think we shoud look for air alternatives. I think turbowatch is worth taking a look at. |
Not working on it because I am not the user and don't understand air, so close it. Feel free to propose new solutions. |
(I do not use
air
, this issue is just for helping debugging developers reported problem)It seems that the
make watch
may not work well in some cases:air logs:
If a file is changed when a build is in progress, air doesn't stop the old build, then two Gitea processes will be started.
Two running Gitea processes will conflict with each other: port listen, leveldb lock, etc.
The text was updated successfully, but these errors were encountered: