Skip to content

The WebSocket client pool should not starve on connect error.#5438

Merged
vietj merged 1 commit into4.xfrom
websocket-pool-should-not-starve-on-connect-error
Jan 10, 2025
Merged

The WebSocket client pool should not starve on connect error.#5438
vietj merged 1 commit into4.xfrom
websocket-pool-should-not-starve-on-connect-error

Conversation

@vietj
Copy link
Member

@vietj vietj commented Jan 9, 2025

Motivation:

The client WebSocket pool implementation (which is not really a pool but instead a semaphore + a wait queue) does not decrement the semaphore when the connection fail to be established.

Currently, no operation is done beside calling back the caller. As consequence, the wait queue fills with new requests and never satisfy them since.

Changes:

When the connection fails, the semaphore should be released and check the wait queue for pending requests.

@vietj vietj added this to the 4.5.12 milestone Jan 9, 2025
@vietj vietj self-assigned this Jan 9, 2025
@vietj vietj added the bug label Jan 9, 2025
@vietj vietj linked an issue Jan 9, 2025 that may be closed by this pull request
@vietj vietj force-pushed the websocket-pool-should-not-starve-on-connect-error branch 2 times, most recently from a61da31 to 1861820 Compare January 9, 2025 21:06
Motivation:

The client WebSocket pool implementation (which is not really a pool but instead a semaphore + a wait queue) does not decrement the semaphore when the connection fails to be established.

Currently, no operation is done beside calling back the caller. As consequence, the wait queue fills with new requests and never satisfy them since.

Changes:

When the connection fails, the semaphore should be released and check the wait queue for pending requests.
@vietj vietj force-pushed the websocket-pool-should-not-starve-on-connect-error branch from 1861820 to c0da53c Compare January 9, 2025 21:58
@vietj vietj merged commit 03dc47a into 4.x Jan 10, 2025
7 checks passed
@vietj vietj deleted the websocket-pool-should-not-starve-on-connect-error branch January 10, 2025 08:18

@Override
public void close() {
System.out.println("CLOSING POOL " + waiters.size());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This console print statement should be removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vertx 4.2.6 WebsocketEndpoint InflightRequest Not Reducing

2 participants