Skip to content

Honor allow_half_open when a client aborts early - #13560

Open
bneradt wants to merge 1 commit into
apache:masterfrom
bneradt:honor-allow-half-open-on-client-abort
Open

Honor allow_half_open when a client aborts early#13560
bneradt wants to merge 1 commit into
apache:masterfrom
bneradt:honor-allow-half-open-on-client-abort

Conversation

@bneradt

@bneradt bneradt commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Operators who set proxy.config.http.allow_half_open to 0 expect a
client abort to tear down the transaction, including the connection to
the origin server. Since 10.1, that no longer happens when the client
goes away before the origin has sent its response header: ATS holds the
origin connection open until the response arrives, so a slow origin
combined with impatient clients can accumulate connections until
max_requests_in or connections_throttle is reached.

The path that keeps the state machine alive in that window exists so
that background fill works for clients whose transport cannot half
close a connection, such as TLS and HTTP/2. It was reachable for two
unrelated reasons, though, since ProxyTransaction::allow_half_open()
reports false both for those transports and for an operator who
disabled half open connections outright.

This patch distinguishes the two by also requiring that half open
connections be configured before keeping the transaction alive for a
background fetch. Background fill continues to work for TLS and HTTP/2
clients under the default configuration, while disabling half open
connections once again aborts the transaction and drops the origin
connection. The accompanying autest exercises both outcomes with an
origin that reports whether the proxy closed the connection, and the
documentation for allow_half_open now describes the interaction.

Fixes: #13549

Operators who set proxy.config.http.allow_half_open to 0 expect a
client abort to tear down the transaction, including the connection to
the origin server. Since 10.1, that no longer happens when the client
goes away before the origin has sent its response header: ATS holds the
origin connection open until the response arrives, so a slow origin
combined with impatient clients can accumulate connections until
max_requests_in or connections_throttle is reached.

The path that keeps the state machine alive in that window exists so
that background fill works for clients whose transport cannot half
close a connection, such as TLS and HTTP/2. It was reachable for two
unrelated reasons, though, since ProxyTransaction::allow_half_open()
reports false both for those transports and for an operator who
disabled half open connections outright.

This patch distinguishes the two by also requiring that half open
connections be configured before keeping the transaction alive for a
background fetch. Background fill continues to work for TLS and HTTP/2
clients under the default configuration, while disabling half open
connections once again aborts the transaction and drops the origin
connection. The accompanying autest exercises both outcomes with an
origin that reports whether the proxy closed the connection, and the
documentation for allow_half_open now describes the interaction.

Fixes: apache#13549
@bneradt bneradt added this to the 11.0.0 milestone Aug 18, 2026
Copilot AI lite review requested due to automatic review settings August 18, 2026 19:54
@bneradt bneradt self-assigned this Aug 18, 2026

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 reached their quota limit.

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.

Connections not being closed on client abort when allow_half_open is disabled

2 participants