Skip to content

Keep active connection metrics balanced when dropping connections #1687

@dkropachev

Description

@dkropachev

Some successful connection attempts are counted in metrics before the ready-connection handler later drops them.

Code permalink:

} else if evt.requested_shard.is_some() {

Several paths can drop connections without decrementing the active connection gauge, including wrong-shard shard-aware retries, excess-pool clearing, and resharding. With metrics enabled, the total connection count can remain permanently above the actual number of live connections.

Suggested direction: balance the active-connection metric for every path that drops a previously-counted successful connection.

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions