Skip to content

Revert "Emit http.disconnect on server shutdown for streaming responses" (#2829)#2913

Merged
Kludex merged 2 commits into
mainfrom
revert-2829-shutdown-disconnect
Apr 21, 2026
Merged

Revert "Emit http.disconnect on server shutdown for streaming responses" (#2829)#2913
Kludex merged 2 commits into
mainfrom
revert-2829-shutdown-disconnect

Conversation

@Kludex
Copy link
Copy Markdown
Owner

@Kludex Kludex commented Apr 21, 2026

Summary

Reverts #2829.

Requiring a second CTRL+C to force-quit a streaming app is the expected behavior. Infra/process managers (Kubernetes, systemd, etc.) send a second signal after the graceful shutdown period expires, which will force-kill the process exactly as the user intends. Apps that use the graceful window to flush in-flight work should not have that window cut short by a cascading http.disconnect on the first signal.

AI Disclaimer

This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.

…ing down for streaming responses (#2829)"

This reverts commit 587042d.

Requiring a second CTRL+C on streaming apps is expected behavior.
Process managers like Kubernetes send a second signal (SIGKILL) after
the graceful shutdown timeout, so apps relying on the graceful period
to flush work will be force-killed on the second signal as intended.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

📖 Docs preview: https://01c679b9.uvicorn.pages.dev

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 21, 2026

Merging this PR will not alter performance

✅ 24 untouched benchmarks


Comparing revert-2829-shutdown-disconnect (5a95259) with main (73a80c3)

Open in CodSpeed

@Kludex Kludex disabled auto-merge April 21, 2026 10:21
@Kludex Kludex enabled auto-merge (squash) April 21, 2026 10:21
@Kludex Kludex merged commit 7f027f8 into main Apr 21, 2026
24 checks passed
@Kludex Kludex deleted the revert-2829-shutdown-disconnect branch April 21, 2026 10:22
@Kludex Kludex mentioned this pull request Apr 21, 2026
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