You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "pjfanning (via GitHub)" <gi...@apache.org> on 2026/10/13 22:49:19 UTC
[PR] fix: close pool connection after an early response [pekko-http]
pjfanning opened a new pull request, #1349:
URL: https://github.com/apache/pekko-http/pull/1349
### Motivation
When a response completed before the streamed request entity was fully sent (an "early" response), the host connection pool returned the slot to `Idle` once the request entity completed and reused the connection. The client cannot tell whether the server read the rest of the request entity, and a server that did not could misinterpret the remaining data as the next request. The Pekko HTTP server already closes the connection after an early response for the same reason.
### Modification
`SlotState.WaitingForEndOfRequestEntity` now moves to `ToBeClosed` when the request entity completes or fails, instead of `idle(ctx)`.
### Result
A connection that saw an early response is not reused; the next request opens a new connection. Streaming uploads to servers that answer early and keep the connection alive now cost one reconnect.
### Tests
- `sbt "http-core/testOnly org.apache.pekko.http.impl.engine.client.*"` - passed (179 succeeded, 0 failed)
- Updated `SlotStateSpec` ("consider a slot 'idle' only when the request has been successfully sent" now expects `ToBeClosed`), added a `SlotStateSpec` test for request entity failure after an early response, and added `HostConnectionPoolSpec` "not reuse the connection after an early response" (PassThrough transport only, since the Pekko server engines close the connection themselves). All three fail without the fix.
- `scalafmt` run on changed files. MiMa not run: only method bodies in package-private internal code changed.
### References
None - client pool hardening for early responses
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix: close pool connection after an early response [pekko-http]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning closed pull request #1349: fix: close pool connection after an early response
URL: https://github.com/apache/pekko-http/pull/1349
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix: close pool connection after an early response [pekko-http]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on PR #1349:
URL: https://github.com/apache/pekko-http/pull/1349#issuecomment-6213251479
let's see if #1350 is merged and if that is rejected - we can see if this is acceptable
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org