Skip to content

connection: fix race on future release - #597

Merged
oleg-jukovec merged 1 commit into
masterfrom
oleg-jukovec/fix-unlock-unlocked-mutex
Aug 19, 2026
Merged

oleg-jukovec merged 1 commit into
masterfrom
oleg-jukovec/fix-unlock-unlocked-mutex

Conversation

@oleg-jukovec

Copy link
Copy Markdown
Collaborator

The wait channel was closed while the future's mutex was still held, so a caller woken by WaitChan() could call Release() and zero the future before the internal goroutine finished unlocking the mutex. This caused "unlock of unlocked mutex" panics under concurrent load.

Follows #595

What has been done? Why? What problem is being solved?

I didn't forget about (remove if it is not applicable):

Follows #595

@oleg-jukovec
oleg-jukovec force-pushed the oleg-jukovec/fix-unlock-unlocked-mutex branch from a56b2df to 7d41a16 Compare August 18, 2026 11:46
@oleg-jukovec
oleg-jukovec force-pushed the oleg-jukovec/fix-unlock-unlocked-mutex branch from 7d41a16 to 51e41d0 Compare August 18, 2026 11:48
Comment thread future.go Outdated
The wait channel was closed while the future's mutex was still
held, so a caller woken by WaitChan() could call Release() and
zero the future before the internal goroutine finished unlocking
the mutex. This caused "unlock of unlocked mutex" panics under
concurrent load.

Follows #595
@oleg-jukovec
oleg-jukovec force-pushed the oleg-jukovec/fix-unlock-unlocked-mutex branch from 51e41d0 to 02d4cba Compare August 19, 2026 06:32
@oleg-jukovec
oleg-jukovec requested a review from sssciel August 19, 2026 06:34
@oleg-jukovec
oleg-jukovec merged commit a48a2fd into master Aug 19, 2026
26 of 27 checks passed
@oleg-jukovec
oleg-jukovec deleted the oleg-jukovec/fix-unlock-unlocked-mutex branch August 19, 2026 07:22
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.

3 participants