Skip to content

Use ThreadingHTTPServer to fix deadlock on concurrent requests#179

Open
domdomegg wants to merge 1 commit intonschloe:mainfrom
domdomegg:fix-concurrent-deadlock
Open

Use ThreadingHTTPServer to fix deadlock on concurrent requests#179
domdomegg wants to merge 1 commit intonschloe:mainfrom
domdomegg:fix-concurrent-deadlock

Conversation

@domdomegg
Copy link

tuna's server mode uses HTTPServer (single-threaded) with HTTP/1.1. When a browser loads a page it sends concurrent requests (HTML + CSS + JS + favicon), and the single-threaded server deadlocks on HTTP keep-alive connections — it blocks reading for a follow-up request on one connection instead of accepting the next queued connection.

This switches to ThreadingHTTPServer (which python -m http.server also uses) so each connection is handled in its own thread.

Fixes #178

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Server deadlocks after concurrent requests (HTTPServer + HTTP/1.1 keep-alive)

1 participant