Skip to content

APIGOV-SDB01 - fix deatlock found in unit test#1033

Merged
sbolosan merged 1 commit intomainfrom
APIGOV-SDB01
Apr 30, 2026
Merged

APIGOV-SDB01 - fix deatlock found in unit test#1033
sbolosan merged 1 commit intomainfrom
APIGOV-SDB01

Conversation

@sbolosan
Copy link
Copy Markdown
Collaborator

resetEndpointSampling was holding endpointsLock across a call to stopCounterResetter(), which does a blocking channel send. This caused a deadlock: the channel receiver (samplingCounterReset) was blocked on samplingLock, which was held by ShouldSampleTransaction goroutines that were in turn waiting on endpointsLock.

Fixed by extracting hasRemainingEndpoints() to scope the lock to just the map read — defer now fires at the right time, and the channel send in stopCounterResetter() happens completely lock-free.

@sbolosan sbolosan merged commit 2de1666 into main Apr 30, 2026
2 checks passed
@sbolosan sbolosan deleted the APIGOV-SDB01 branch April 30, 2026 15:56
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.

4 participants