[PATCH] auto-reload fail by design
|Reported by:||Owned by:|
|Cc:||leho@…, Thijs Triemstra||Branch:|
It is rather funny that nobody spotted it before, but.. autoreload option designed for development mode actually stops to work once you have a syntax error in your script and the script fails to load.
How does this happen. The normal flow with —auto-reload is to start new process for Trac and keep current process solely for monitoring how child behaves. If the child exits with the error code 3, it is restarted. Child itself runs two threads - first it creates thread where a main function is executed. This function processes requests and as a side effect imports all required files filling sys.modules list (shared with main thread, because, well, everything is shared between threads). Main thread then goes into infinite loop to periodically check timestamps of files in sys.modules and exit with error code 3 if timestamp mismatches.
Now the problem. If there is a syntax error in .py file it is not added into sys.modules and will not be checked to restart child process when the error is fixed.
P.S. I've added it to 0.11.7, because I'd like to see any fix in 0.11. It will be handy for exploring plugins behavior when porting them to 0.12
Change History (17)
comment:11 by , 11 years ago
|Priority:||normal → lowest|
|Severity:||critical → minor|
comment:13 by , 11 years ago
|Summary:||auto-reload fail by design → [PATCH] auto-reload fail by design|