pjfanning opened a new pull request, #1368:
URL: https://github.com/apache/pekko-http/pull/1368

   ### Motivation
   When the HTTP/2 client `PersistentConnection` exhausted its connection 
attempts, it failed the whole stream without answering the request that 
triggered the attempts. A caller correlating responses to requests (e.g. via 
`RequestResponseAssociation` attributes) never got a response for that request.
   
   ### Modification
   - `PersistentConnection`: when the last connection attempt fails and a 
request is waiting, emit a `503 Service Unavailable` response carrying the 
request's attributes, then fail the stage.
   - `Http2PersistentClientSpec`:
     - expect the failed response before the stream error (in the "eventually 
fail" and "not hammer the service" tests);
     - with backoff, bound the wait for that response by the worst-case 
remaining backoff (600 + 800 × 3 − 1200 = 1800 ms, plus connection-attempt 
time) via `expectNext(max)`. akka/akka-http#4259 used `awaitAssert` around 
`expectError()` for the same thing, but retrying a call that consumes stream 
elements doesn't help, so an explicit bound is used instead;
     - tolerate the `Unexpected termination of TLS actor` warning caused by a 
previous test case shutting down (akka/akka-http#4244).
   
   ### Result
   The triggering request gets a `503` response with its attributes before the 
stream fails.
   
   ### Tests
   - `sbt "http2-tests/Test/testOnly 
org.apache.pekko.http.impl.engine.http2.Http2PersistentClient*"`: 26 passed 
(TLS and plaintext)
   - Same specs without the `PersistentConnection` change: 6 failed 
(directional)
   - `scalafmt --mode diff-ref=upstream/main`: no changes
   - MiMa not run: `PersistentConnection` is `private[http2]`, no public API 
change
   
   ### References
   Port of akka/akka-http#4322, together with the test fixes it builds on, 
akka/akka-http#4259 and akka/akka-http#4260, which all touch 
`Http2PersistentClientSpec` (Apache 2.0 now applies, since the Akka HTTP 10.6.0 
license change date of 2026-10-23).
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to