Repository navigation
Drop uWSGI threads, which silently disable harakiri - #860
Merged
Merged
Conversation
harakiri is armed per worker, not per request: with two threads, a sibling request finishing clears the deadline of the one still running, so a busy worker never hits --harakiri. Threads also double the requests lost when a worker dies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
--harakiriis armed per worker, not per request:uwsgi.workers[wid].harakiriis one field, set when a request starts and zeroed when any request on that worker finishes. With--threads=2, a sibling request completing on the other thread switches the timeout off under a request that is still running, so a worker with traffic never reaches its deadline. Threads also double the in-flight requests lost when a worker crashes.Validation. Image built from this template, a WSGI app with a 12 s endpoint,
--workers=1 --harakiri=3, four concurrent clients hitting a fast endpoint in parallel:--threads=2--threadsIn medical-backend (fandsdev/medical-backend#606) the longest server span in three weeks of traces was 310 s under
--harakiri=25, and 504s arrived in exact pairs per worker segfault. It has run there without threads since August.🤖 Generated with Claude Code