ham1 opened a new pull request, #6893: URL: https://github.com/apache/jmeter/pull/6893
## Description HttpClient's asynchronous transport completes the response future before it returns the connection to the pool. An HTTP/2 sample could therefore finish while its connection was still leased, and the next sample could open a second connection. The sampler now waits for the exchange to finish: - The wait starts after the sample's end time is recorded, so it does not count in the elapsed time. Latency and connect time are unchanged. - It is capped at one second, in case HttpClient never reports completion. From reading its source, this could happen with a 204 or 304 reply to a proxy `CONNECT`, or a successful reply that arrives while the request body is still being sent. I have not tested either case. - An interrupt during the wait keeps the successful response and leaves the interrupt flag set. - For redirect and embedded resource parent samples, a wait between two child requests still falls within the parent's time. With HTTP/2 multiplexing on (the default), only the first exchange on each new connection should be affected by the race. With it off, any back-to-back samples could be. ## Motivation and Context `TestHTTPHC5Features.doesNotRevalidatePooledHttp2ConnectionWithoutAnIdleGap` failed on the s390x Jenkins job. I believe this race is the cause. ## How Has This Been Tested? - A new test delays the release of the connection by 500ms, and checks that two samples share one connection and that the delay is not in the elapsed time. It fails without the fix. - A second test covers the interrupt. - `TestHTTPHC5Features` and `./gradlew classes style` pass locally. I could only reproduce the race with the artificial delay, and have not run the change on s390x. ## Types of changes - Bug fix (non-breaking change which fixes an issue) -- 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]
