Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race condition in muxer if connection is closed immediately after handshake #710

Closed
agaffney opened this issue Sep 18, 2024 · 0 comments · Fixed by #712
Closed

Race condition in muxer if connection is closed immediately after handshake #710

agaffney opened this issue Sep 18, 2024 · 0 comments · Fixed by #712
Assignees

Comments

@agaffney
Copy link
Contributor

When a connection is closed almost immediately after a successful handshake, the muxer shutdown can trigger while protocols are still being registered, causing the m.waitGroup.Wait() to start before all of the m.waitGroup.Add() calls have completed, which causes a panic.

panic: sync: WaitGroup is reused before previous Wait has returned

goroutine 3362 [running]:
sync.(*WaitGroup).Wait(0xc000b5ef78?
)
    /opt/hostedtoolcache/go/1.21.13/x64/src/sync/waitgroup.go:118 +0x74
github.com/blinklabs-io/gouroboros/muxer.New.func1()
    /home/runner/go/pkg/mod/github.com/blinklabs-io/gouroboros@v0.93.2/muxer/muxer.go:92 +0x48
created by github.com/blinklabs-io/gouroboros/muxer.New in goroutine 52
    /home/runner/go/pkg/mod/github.com/blinklabs-io/gouroboros@v0.93.2/muxer/muxer.go:85 +0x198
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 a pull request may close this issue.

1 participant