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

Pubsub panic - send on closed channel #4066

Closed
mateon1 opened this issue Jul 13, 2017 · 2 comments · Fixed by libp2p/go-libp2p-pubsub#34
Closed

Pubsub panic - send on closed channel #4066

mateon1 opened this issue Jul 13, 2017 · 2 comments · Fixed by libp2p/go-libp2p-pubsub#34
Labels

Comments

@mateon1
Copy link
Contributor

mateon1 commented Jul 13, 2017

Version information: 0.4.9 on amd64/linux, compiled with go1.8.2

Type: Bug

Severity: Critical

Description:

IPFS panicked with the following message when pubsub was used.

panic: send on closed channel

goroutine 2828634 [running]:
gx/ipfs/QmYPKo97ssdv3Bsk9sRAS5ZjahGg9Stzys3vybu3r7VuB5/floodsub.(*PubSub).publishMessage.func1(0xc4242ef320, 0xc42312faa0)
        /tmp/nix-build-ipfs-0.4.9.drv-0/go/src/gx/ipfs/QmYPKo97ssdv3Bsk9sRAS5ZjahGg9Stzys3vybu3r7VuB5/floodsub/floodsub.go:346 +0x4b
created by gx/ipfs/QmYPKo97ssdv3Bsk9sRAS5ZjahGg9Stzys3vybu3r7VuB5/floodsub.(*PubSub).publishMessage
        /tmp/nix-build-ipfs-0.4.9.drv-0/go/src/gx/ipfs/QmYPKo97ssdv3Bsk9sRAS5ZjahGg9Stzys3vybu3r7VuB5/floodsub/floodsub.go:346 +0x2fd

This is not easily reproducible, the daemon was online for several days, including a 20 minute long loss of internet connection.

@whyrusleeping
Copy link
Member

@vyzo @Stebalien any idea on this one?

Stebalien added a commit to libp2p/go-libp2p-pubsub that referenced this issue Aug 30, 2017
Instead of spawning a go routine for every message sent to every peer, buffer
them (actually, we already buffer 32 so this didn't need to be changed) and drop
messages when the buffer fills up.

fixes ipfs/kubo#4066

(writing to a channel in a go routine can be dangerous...)
@Stebalien
Copy link
Member

Fix: libp2p/go-libp2p-pubsub#34. Would you like me to do a gx release and propagate it or are you fine waiting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants