RFR: 8338569: HTTP/1.1 CleanupTrigger may be triggerred after the next exchange started [v4]

Daniel Fuchs dfuchs at openjdk.org
Wed Aug 28 17:06:34 UTC 2024


> The java/net/httpclient/DigestEchoClient.java fails intemittently with IOException: HTTP/1.1 header parser received no bytes.
> 
> Analysis shows that this is caused by the CleanupTrigger which receives data after the reused connection has been taken out of the HTTP/1.1 clear pool. This should not happen.
> 
> The issue is caused by deferred registration of read subscribers with the SocketTube. The subscribers are registered within the SelectorManager thread to ensure proper interaction with the read method.
> 
> Sometimes pending subscribers are pushed faster than they are actually subscribed, which may cause the wrong subscriber to be subscribed at the wrong time. 
> 
> This is a redo of [JDK-8336655](https://bugs.openjdk.org/browse/JDK-8336655) which was a failed fix.
> The main difference is that the new fix uses a ConcurrentLinkedQueue to make sure all subscribers get subscribed and dropped in the right sequence. Marking previous subscription as stopped ensures that data can only be routed to the last subscriber in the queue.

Daniel Fuchs has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:

 - Copyright year updates
 - Merge branch 'master' into CleanupTrigger-2-JDK-8338569
 - Update src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java
 - Better exception message for ShutdownNow
 - 8338569

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/20623/files
  - new: https://git.openjdk.org/jdk/pull/20623/files/dc52bbc1..702a88f0

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=20623&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20623&range=02-03

  Stats: 13197 lines in 475 files changed: 8524 ins; 2833 del; 1840 mod
  Patch: https://git.openjdk.org/jdk/pull/20623.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20623/head:pull/20623

PR: https://git.openjdk.org/jdk/pull/20623


More information about the net-dev mailing list