Skip to content

fix: avoid legacy WebSocket keepalive failures with Uvicorn 0.50+ - #12276

Merged
mscolnick merged 2 commits into
mainfrom
ms/websockets-keepalive-ping-errors
Dec 3, 2026
Merged

mscolnick merged 2 commits into
mainfrom
ms/websockets-keepalive-ping-errors

Conversation

@mscolnick

@mscolnick mscolnick commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

This pull request was authored by a coding agent.

Require Uvicorn 0.50.0, the first release that selects the Sans-I/O WebSocket backend by default. This avoids the legacy backend’s keepalive assertion when a ping and notebook output both wait for the socket to drain.

Remove startup compatibility branches for older Uvicorn versions. The startup regression checks the selected backend and keepalive settings in both edit and run mode.


Context: we hit another issue backpressure on the WebSocket. Keeping compatibility with older uvicorn and fixing these bugs have become fragile and cumbersome. Instead, we are setting the min uvicorn to 0.50.0 (fiv months old) as this will give a much better experience to marimo users.

@mscolnick
mscolnick marked this pull request as ready for review December 3, 2026 21:36
Copilot AI balanced review requested due to automatic review settings December 3, 2026 21:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

kirangadhave
kirangadhave previously approved these changes Dec 3, 2026
@mscolnick mscolnick changed the title fix: keep WebSocket pings alive under write backpressure fix: avoid legacy WebSocket keepalive failures with Uvicorn 0.50+ Dec 3, 2026
@mscolnick
mscolnick requested a review from akshayka as a code owner December 3, 2026 21:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The test can pass without the new override because websockets 14/15 already locks drain(), leaving the new lock’s behavior unverified.

No open issues 🎉

Review effort: Balanced

@mscolnick
mscolnick merged commit 5fe3d28 into main Dec 3, 2026
58 of 84 checks passed
@mscolnick
mscolnick deleted the ms/websockets-keepalive-ping-errors branch December 3, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants