]> git.feebdaed.xyz Git - 0xmirror/grpc-go.git/commit
transport: Increment metrics only when the stream is active (#8573)
authorElric <tbnsok40@gmail.com>
Tue, 7 Oct 2025 22:25:07 +0000 (07:25 +0900)
committerGitHub <noreply@github.com>
Tue, 7 Oct 2025 22:25:07 +0000 (15:25 -0700)
commit9ff80a7f245ceb2aad36ef6987f34c9441dbd43e
treea8e3ec41cc749961bbbf0e27f5f728d3aa6d3970
parentc9cca95c239fc495a1ce89be2dc7aa0f3a889f67
transport: Increment metrics only when the stream is active (#8573)

Fixes: https://github.com/grpc/grpc-go/issues/8529
This PR fixes to increment metrics only when the stream is active which
is found in the activeStreams map.

#### as-is
- The deleteStream was incrementing channelz metrics every time it was
called, even when stream was already removed from activeStreams or not
exists in activeStreams.

#### to-be
- Added check to ensure metrics are only incremented once when a stream
is actually removed from activeStreams.

RELEASE NOTES:
* server: Fix a bug that caused overcounting of channelz metrics for
successful and failed streams.
internal/transport/http2_server.go
internal/transport/transport_test.go