Skip to content

Avoid preview hangs caused by idle browser connections - #733

Open
Chessing234 wants to merge 1 commit into
teorth:mainfrom
Chessing234:codex/threaded-preview-server
Open

Chessing234 wants to merge 1 commit into
teorth:mainfrom
Chessing234:codex/threaded-preview-server

Conversation

@Chessing234

Copy link
Copy Markdown
Contributor

A browser can open a TCP connection before sending an HTTP request. The single-threaded preview server then waits on that socket and cannot answer another connection, making the preview appear hung. Use the standard-library ThreadingHTTPServer so idle preconnections do not block active requests.

Validation: the socket regression waits until the idle connection is accepted, then requests the favicon over a second connection. It times out with the current server and receives 204 with this change. python3 -m unittest discover -s tests and whitespace checks pass. No Lean changes.

AI assistance: OpenAI Codex.

This branch has not been deployed

No deployments
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.

1 participant