Repository navigation
Close a connection when the client closes it - #7963
Merged
Merged
Conversation
xiasongh
force-pushed
the
song/debug-customer-issue-61bc4c
branch
from
November 13, 2026 00:17
d4b18b8 to
b524436
Compare
Contributor
|
What I ran
Gaps (medium)
Otherwise LGTM: the fix is small and well explained, and the commit message is good. |
xiasongh
force-pushed
the
song/debug-customer-issue-61bc4c
branch
from
November 13, 2026 01:21
b524436 to
2ac9d6a
Compare
It is the first release whose `HttpServer` exposes `h1_allow_half_closed`.
A client that stops a /logs request on a pipeline that writes no new lines leaked a connection in the API server and the runner, and a log follower in the runner. Actix kept the half-closed connection open until a write failed, and nothing was written. The API server and the runner now close the connection when they read EOF from the client. This needs actix-web 4.12.
A client that disconnects from a streaming response that writes nothing, such as /coordination/status while the status does not change, leaked the connection and the stream's state. Actix kept the half-closed connection open until a write failed. The pipeline's HTTP server now closes the connection when it reads EOF from the client. Because a disconnect now cancels the handler, Controller::rebalance requests the step from the command callback instead of after it awaits the reply.
xiasongh
force-pushed
the
song/debug-customer-issue-61bc4c
branch
from
November 13, 2026 01:39
5eb1e44 to
8c985bd
Compare
xiasongh
commented
Nov 13, 2026
| self.inner | ||
| .send_command(Command::Rebalance(Box::new(move |result| { | ||
| if result.is_ok() { | ||
| inner.request_step(); |
Contributor
Author
There was a problem hiding this comment.
do we need to make this change?
blp
approved these changes
Nov 13, 2026
blp
left a comment
Member
There was a problem hiding this comment.
This is fascinating, thanks.
I wonder whether we use any half-closed connections in practice intentionally (I simply don't know).
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.
Issue
A client that disconnects from a streaming response that writes nothing leaks the connection and the stream's state. Actix keeps the half-closed connection open until a write fails, and nothing is written.
GET /v0/pipelines/{name}/logson a pipeline that writes no new lines leaks a connection in both, and a log follower in the runner. Memory grows with each such request until the runner is OOM-killed./coordination/status,/coordination/step/status,/coordination/checkpoint/statusand similar while the value does not change.Fix
All three servers set
h1_allow_half_closed(false), so they close the connection when they read EOF from the client.HttpServerexposes this setting from actix-web 4.12, so actix-web goes from 4.11.0 to 4.12.0.A disconnect now cancels the handler, so
Controller::rebalancerequests the step from the command callback instead of after it awaits the reply.