JDK-8357639 : DigestEchoClient fails intermittently due to: java.io.IOException: Data received while in pool
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 25
  • Priority: P4
  • Status: In Progress
  • Resolution: Unresolved
  • Submitted: 2025-05-23
  • Updated: 2025-05-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
java.lang.RuntimeException: [4 s, 730 ms, 895036 ns]  Unexpected exception java.io.IOException: HTTP/1.1 header parser received no bytes for http://127.0.0.1:44849/foo/?iteration=4,async=false,addHeaders=true,preemptive=false,expectContinue=false,version=HTTP_2,basicCount=412
	at DigestEchoClient.testBasic(DigestEchoClient.java:569)
	at DigestEchoClient.main(DigestEchoClient.java:292)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
	at java.base/java.lang.Thread.run(Thread.java:1447)
Caused by: java.io.IOException: HTTP/1.1 header parser received no bytes
	at java.net.http/jdk.internal.net.http.HttpClientImpl.send(HttpClientImpl.java:1010)
	at java.net.http/jdk.internal.net.http.HttpClientFacade.send(HttpClientFacade.java:133)
	at DigestEchoClient.testBasic(DigestEchoClient.java:480)
	... 5 more
Caused by: java.io.IOException: HTTP/1.1 header parser received no bytes
	at java.net.http/jdk.internal.net.http.common.Utils.wrapWithExtraDetail(Utils.java:521)
	at java.net.http/jdk.internal.net.http.Http1Response$HeadersReader.onReadError(Http1Response.java:590)
	at java.net.http/jdk.internal.net.http.Http1AsyncReceiver.checkForErrors(Http1AsyncReceiver.java:304)
	at java.net.http/jdk.internal.net.http.Http1AsyncReceiver.flush(Http1AsyncReceiver.java:270)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$LockingRestartableTask.run(SequentialScheduler.java:182)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask.run(SequentialScheduler.java:149)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:207)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
	... 1 more
Caused by: java.io.IOException: connection closed locally
	at java.net.http/jdk.internal.net.http.SocketTube.signalClosed(SocketTube.java:159)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection.close(PlainHttpConnection.java:367)
	at java.net.http/jdk.internal.net.http.ConnectionPool.cleanup(ConnectionPool.java:554)
	at java.net.http/jdk.internal.net.http.ConnectionPool$CleanupTrigger.triggerCleanup(ConnectionPool.java:584)
	at java.net.http/jdk.internal.net.http.ConnectionPool$CleanupTrigger.onNext(ConnectionPool.java:601)
	at java.net.http/jdk.internal.net.http.ConnectionPool$CleanupTrigger.onNext(ConnectionPool.java:565)
	at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$InternalReadSubscription.read(SocketTube.java:895)
	at java.net.http/jdk.internal.net.http.SocketTube$SocketFlowTask.run(SocketTube.java:181)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:207)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:280)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:233)
	at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$InternalReadSubscription.handleSubscribeEvent(SocketTube.java:736)
	at java.net.http/jdk.internal.net.http.AsyncTriggerEvent.handle(AsyncTriggerEvent.java:54)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:1372)
Caused by: java.io.IOException: Unexpected cleanup triggered for non pooled connection
	at java.net.http/jdk.internal.net.http.ConnectionPool.cleanup(ConnectionPool.java:553)
	... 11 more
Caused by: java.io.IOException: Data received while in pool
	... 10 more

Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/25416 Date: 2025-05-23 14:35:30 +0000
23-05-2025

We should probably pause reading at the selector level before connecting the flows with the new publisher/subscriber pair. This should ensure that data doesn't reach the "old" subscriber, if the new write publisher manage to send data before the new read subscriber is subscribed.
23-05-2025

The fix for JDK-8338569 has improved the situation but apparently didn't fix it completely.
23-05-2025