On Mon, 19 Aug 2024 09:36:54 GMT, Daniel Fuchs <dfu...@openjdk.org> wrote:

> 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.

This pull request has now been integrated.

Changeset: 723588a4
Author:    Daniel Fuchs <dfu...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/723588a4e78d25f0ef3c4cdaeb377aedc3a352d4
Stats:     183 lines in 6 files changed: 119 ins; 16 del; 48 mod

8338569: HTTP/1.1 CleanupTrigger may be triggerred after the next exchange 
started

Reviewed-by: jpai

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

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

Reply via email to