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

panic: send on closed channel #134

Closed
aletheia7 opened this issue Mar 27, 2024 · 2 comments
Closed

panic: send on closed channel #134

aletheia7 opened this issue Mar 27, 2024 · 2 comments

Comments

@aletheia7
Copy link

Version: v3.1.0

Getting golang "panic: send on closd channel" error on Subscribe and Unsubscribe.

panic: send on closed channel
goroutine 31 [running]:
github.com/go-stomp/stomp/v3.(*Subscription).closeChannel(...)
        github.com/go-stomp/stomp/[email protected]/subscription.go:150
github.com/go-stomp/stomp/v3.(*Subscription).Unsubscribe(0xc00030e0c0?, {0x0, 0x0, 0x0?})
        github.com/go-stomp/stomp/[email protected]/subscription.go:89 +0x51c
panic: send on closed channel
goroutine 127 [running]:
github.com/go-stomp/stomp/v3.(*Subscription).closeChannel(...)
        github.com/go-stomp/stomp/[email protected]/subscription.go:150
github.com/go-stomp/stomp/v3.(*Subscription).readLoop(0xc000316600, 0xc0003c04e0)
        github.com/go-stomp/stomp/[email protected]/subscription.go:210 +0x8f3
created by github.com/go-stomp/stomp/v3.(*Conn).Subscribe in goroutine 48
        github.com/go-stomp/stomp/[email protected]/conn.go:696 +0x989
@circadi
Copy link

circadi commented Apr 12, 2024

Same issue observed when upgrading to 3.1.0:

panic: send on closed channel

goroutine 98 [running]:
github.com/go-stomp/stomp/v3.(*Subscription).closeChannel(...)
        /home/dev/.gvm/pkgsets/go1.21.8/global/pkg/mod/github.com/go-stomp/stomp/[email protected]/subscription.go:150
github.com/go-stomp/stomp/v3.(*Subscription).Unsubscribe(0x0?, {0x0, 0x0, 0x0?})
        /home/dev/.gvm/pkgsets/go1.21.8/global/pkg/mod/github.com/go-stomp/stomp/[email protected]/subscription.go:89 +0x533

Version 3.0.5 doesn't have this bug when unsubscribe, I suspect it's due to the following fix that closed the channel:

v3.0.5...v3.0.6

mschneider82 added a commit to mschneider82/stomp that referenced this issue Jul 10, 2024
worg added a commit that referenced this issue Jul 14, 2024
close channel only once. fixes panic #134
@worg
Copy link
Collaborator

worg commented Jul 15, 2024

closed by #135

@worg worg closed this as completed Jul 15, 2024
sraghavan-drio pushed a commit to drio-ai/stomp that referenced this issue Aug 23, 2024
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

No branches or pull requests

3 participants