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

Channeler sometimes panics while handling destroy command #296

Open
twavv opened this issue Mar 30, 2021 · 1 comment
Open

Channeler sometimes panics while handling destroy command #296

twavv opened this issue Mar 30, 2021 · 1 comment

Comments

@twavv
Copy link

twavv commented Mar 30, 2021

This seems to happen when cleaning up tests.

Context:
In my test, I have a defer c.Destroy() where c is a Channeler. This seems to occasionally (maybe ~10% of the time) cause the channeler goroutine to panic while trying to pipe.RecvMessage:

panic: recv frame error

goroutine 34 [running]:
github.com/zeromq/goczmq.(*Channeler).channeler(0xc00022e0c0, 0xc0002203c0, 0xc000220420)
        /Users/travigd/Mynerva/kernel-sidecar-go/vendor/github.com/zeromq/goczmq/channeler.go:177 +0x5ac
created by github.com/zeromq/goczmq.newChanneler
        /Users/travigd/Mynerva/kernel-sidecar-go/vendor/github.com/zeromq/goczmq/channeler.go:231 +0x276
// channeler.go
// snip
			case "destroy":
				err = pipe.SendFrame([]byte("destroy"), FlagNone)
				if err != nil {
					panic(err)
				}
				_, err = pipe.RecvMessage()
				if err != nil {
					panic(err)
                                     // ^^^^^^^^^^ this is the bit that panics
				}
				goto ExitChanneler
// snip

My guess was that something about the timing (trying to handle it during the test cleanup) causes it to panic, but I added a time.Sleep for one second after the destroy and it doesn't seem to fix it.

@twavv
Copy link
Author

twavv commented Mar 30, 2021

This might be fixed now - I was using 4.1. (related: #279)

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

1 participant