mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-08-30 13:50:55 +00:00
1dcdb72054
My previous commit ensured that we called the DESTROY hook but we wouldn't properly call the atexit hook. Now when you start uWSGI as instructed in that commit you'll get this: * localhost:1234?0: $$: Calling DESTROY * localhost:1234?1: *** psgix.harakiri.commit requested *** ...The work of process 523 is done. Seeya! 523: Calling the atexit hook 523: Calling DESTROY * Ctrl+C (or stop): ^CSIGINT/SIGQUIT received...killing workers... 696: Calling the atexit hook Before this change we wouldn't call the atexit hook when psgix.harakiri.commit was requested by calling localhost:1234?1. To make this work I removed the "if busy do not run atexit hooks" condition added in 1.4-rc2-246-g499202e. Of course uWSGI is going to think the worker is "busy", it's busy being destroyed, that doesn't mean we should skip running the atexit hooks. We'll still skip them under the "if hijacked do not run atexit hooks" condition added in that commit, and the "managing atexit in async mode is a real pain" condition added in 1.0.1-289-gd7e8523. Maybe those are further bugs that need to be solved, but I don't know how to test those modes. Now we'll also call PERL_SET_CONTEXT() and PERL_SYS_TERM() appropriately during destruction. Note that the latter should only be called once even if you have multiple interpreters.