Wait for other worker thread on shutdown
When worker stop due to max-lifetime, the first thread will now wait for additional thread to complet before terminating the worker process.
This fix the issue described in #1894. With this change I never get any request error nor request that don't finish.
I think this will also fix the issue seen on production described in #2480
If you want that I make this wait behind an option, just ask and I'll update this PR.
Is there something missing for this PR ?
Any chance of getting a review on this one? It looks like a straightforward 4-liner bugfix to a very painful issue and I think is impacting my company as well, because the symptoms line up quite well (read: prod outages with the upgrade from Python 3.9.7 to 3.9.8 -- with the problem appearing to happen in uWSGI internal code)
@xrmx ?
This was fixed in #2626 which is now commit 06a22597bd419860904fae6f446d8e3b714f5afa
The fix was shipped in v2.0.25, though the version's release notes are less explicit about the change than the commits https://github.com/unbit/uwsgi/compare/2.0.24...2.0.25