Skip to content

Fix SimpleConnectionPool Waiters#addFirst linking the new node to head.prev instead of head.next - #6465

Merged
vietj merged 1 commit into
eclipse-vertx:4.xfrom
DavideD:fix-waiters-addfirst-4.x
Oct 25, 2026
Merged

vietj merged 1 commit into
eclipse-vertx:4.xfrom
DavideD:fix-waiters-addfirst-4.x

Conversation

@DavideD

@DavideD DavideD commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Backport #6463 (PR #6464) to 4.x

Motivation:

Waiters#addFirst sets node.next to head.prev, i.e. the last waiter instead of the first one. When at least two waiters are queued, the forward chain skips the previous first waiter: it can no longer be polled although size still counts it. The waiter is never served (until it times out) and a later poll can return null while size() > 0, leading to a NullPointerException in SetConcurrency.

addFirst is used by ConnectSuccess when a connection is established with a concurrency of 0 (e.g. an HTTP/2 server advertising MAX_CONCURRENT_STREAMS=0).

Changes:

Link the new node to head.next. Add a pool test with a zero concurrency connection and several queued waiters.

Assisted-by: Claude Opus 5.5 noreply@anthropic.com

…d.prev instead of head.next

Fix eclipse-vertx#6463

Motivation:

Waiters#addFirst sets node.next to head.prev, i.e. the last waiter instead of the first one. When at least two waiters are queued, the forward chain skips the previous first waiter: it can no longer be polled although size still counts it. The waiter is never served (until it times out) and a later poll can return null while size() > 0, leading to a NullPointerException in SetConcurrency.

addFirst is used by ConnectSuccess when a connection is established with a concurrency of 0 (e.g. an HTTP/2 server advertising MAX_CONCURRENT_STREAMS=0).

Changes:

Link the new node to head.next. Add a pool test with a zero concurrency connection and several queued waiters.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
@vietj vietj added this to the 4.5.36 milestone Oct 25, 2026
@vietj
vietj merged commit 4309c4c into eclipse-vertx:4.x Oct 25, 2026
9 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants