Skip to content

Signal the waiter dequeue in DefaultConnectionPool - #6607

Merged
vietj merged 1 commit into
masterfrom
pool-waiter-listener-lifecycle
Dec 1, 2026
Merged

vietj merged 1 commit into
masterfrom
pool-waiter-listener-lifecycle

Conversation

@vietj

@vietj vietj commented Dec 1, 2026

Copy link
Copy Markdown
Member

Motivation:

A submission admitted and served by a create in the same progress
remained covered in the wait queue: the notify section emitted
onEnqueue after the onConnect of the create, reversing the lifecycle
and leaving the SQL client pending metric off by one. onConnect itself
lost its purpose with the acquisition timeout moved into the pool:
client-side timer arming and waiter handle delivery are gone.

Changes:

The pool emits a paired bracket instead: onEnqueue when the waiter
remains in the wait queue - including covered by its own connect - and
onDequeue at every departure: grant, connect failure, close, cancel
and deadline eviction, the latter signalled with the timeout flag and
nothing else; any other dequeue is followed by the acquisition
settlement. An acquisition satisfied without waiting emits neither.

onTimeout is removed from the listener: the timeout flag of onDequeue
replaces it and no pool emits it anymore. onConnect is deprecated for
removal: SimpleConnectionPool alone still emits it and it goes away
with it. SharedHttpClientConnectionGroup fails the request promise on
the timeout dequeue.

Assisted-by: Anthropic Claude (claude-fable-5)
Signed-off-by: Julien Viet julien@julienviet.com

Motivation:

A submission admitted and served by a create in the same progress
remained covered in the wait queue: the notify section emitted
onEnqueue after the onConnect of the create, reversing the lifecycle
and leaving the SQL client pending metric off by one. onConnect itself
lost its purpose with the acquisition timeout moved into the pool:
client-side timer arming and waiter handle delivery are gone.

Changes:

The pool emits a paired bracket instead: onEnqueue when the waiter
remains in the wait queue - including covered by its own connect - and
onDequeue at every departure: grant, connect failure, close, cancel
and deadline eviction, the latter signalled with the timeout flag and
nothing else; any other dequeue is followed by the acquisition
settlement. An acquisition satisfied without waiting emits neither.

onTimeout is removed from the listener: the timeout flag of onDequeue
replaces it and no pool emits it anymore. onConnect is deprecated for
removal: SimpleConnectionPool alone still emits it and it goes away
with it. SharedHttpClientConnectionGroup fails the request promise on
the timeout dequeue.

Assisted-by: Anthropic Claude (claude-fable-5)
Signed-off-by: Julien Viet <julien@julienviet.com>
@vietj vietj added this to the 5.3.0 milestone Dec 1, 2026
@vietj
vietj merged commit 62b8777 into master Dec 1, 2026
13 of 15 checks passed
@vietj
vietj deleted the pool-waiter-listener-lifecycle branch December 1, 2026 17:32
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.

1 participant