Skip to content

Record the size of a client's outgoing message queue on drop#2877

Merged
joshua-spacetime merged 3 commits into
masterfrom
joshua/fix/outgoing-client-message-queue
Jun 18, 2025
Merged

Record the size of a client's outgoing message queue on drop#2877
joshua-spacetime merged 3 commits into
masterfrom
joshua/fix/outgoing-client-message-queue

Conversation

@joshua-spacetime

Copy link
Copy Markdown
Contributor

Description of Changes

If a client's send queue reaches CLIENT_CHANNEL_CAPACITY, we drop the client connection by aborting the task that sends and receives messages from the client. If this abort happens before the task pulls the last messages off the queue, the outgoing queue length metric will never be decremented appropriately.

To fix this, we wrap the message receiver with the metric and decrement the metric when we drop the receiver. The receiver's Drop method will be called when the future is aborted which will now decrement the metric appropriately.

API and ABI breaking changes

None

Expected complexity level and risk

1

Testing

TBD

@joshua-spacetime joshua-spacetime requested a review from gefjon June 17, 2025 23:38
Comment thread crates/core/src/client/client_connection.rs Outdated
Comment thread crates/core/src/client/client_connection.rs
@joshua-spacetime joshua-spacetime force-pushed the joshua/fix/outgoing-client-message-queue branch from 3993ba2 to f3c0634 Compare June 18, 2025 17:07
@joshua-spacetime joshua-spacetime added this pull request to the merge queue Jun 18, 2025
Merged via the queue into master with commit 718712a Jun 18, 2025
19 checks passed
@joshua-spacetime joshua-spacetime deleted the joshua/fix/outgoing-client-message-queue branch June 18, 2025 17:58
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