]> git.feebdaed.xyz Git - 0xmirror/grpc-go.git/commit
credentials/xds: fix goroutine leak in testServer (#8699)
authorPranjali-2501 <87357388+Pranjali-2501@users.noreply.github.com>
Mon, 10 Nov 2025 10:31:28 +0000 (16:01 +0530)
committerGitHub <noreply@github.com>
Mon, 10 Nov 2025 10:31:28 +0000 (16:01 +0530)
commit9c2cd38a2115d210f4499cd472c09f66951968d3
treef9483bc8790eae28f1cd9a995a75a935640afd22
parentdb4cc9fb1d2a1af2cf0789eb68800f847f200574
credentials/xds: fix goroutine leak in testServer (#8699)

Fixes #8694

This PR fixes a goroutine leak in `credentials/xds/xds_client_test.go`.

Previously, the `testServer` used standard `Send()` calls . If a test
timed out or failed before reading the expected value, the `testServer`
goroutine would block indefinitely on the channel, causing a leak.

Replaced blocking `Send` calls with `SendContext` in `handleConn`. This
ensures that if the test ends (canceling the context), the `testServer`
stops trying to send and exits its goroutine gracefully.

RELEASE NOTES: None
credentials/xds/xds_client_test.go
credentials/xds/xds_server_test.go