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

ping command accumulates goroutines on the remote end #2758

Closed
ghost opened this issue May 24, 2016 · 3 comments
Closed

ping command accumulates goroutines on the remote end #2758

ghost opened this issue May 24, 2016 · 3 comments
Assignees
Labels
help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws)

Comments

@ghost
Copy link

ghost commented May 24, 2016

We noticed an increase in goroutines when running the ipfs-watcher program for a few hours: https://github.com/whyrusleeping/ipfs-watcher/blob/master/main.go

It continuously pings all gateway nodes, which works fine, but on the other hand the metrics show thousands of goroutines just for that.

@ghost ghost added the kind/bug A bug in existing code (including security flaws) label May 24, 2016
@Kubuxu
Copy link
Member

Kubuxu commented May 25, 2016

Issue is here (on receiving side):

gx/ipfs/QmZHf9MrEVGXNppqymCAGnvjYeHfVvg8kJkVtDQ8PhLRMT/yamux.(*Stream).Read(0xc82a8b3ad0, 0xc822fdefe0, 0x20, 0x20, 0x0, 0x0, 0x0)
    /home/kubuxu/go/src/gx/ipfs/QmZHf9MrEVGXNppqymCAGnvjYeHfVvg8kJkVtDQ8PhLRMT/yamux/stream.go:125 +0x3f1
gx/ipfs/QmZFdZY2Pjib1dT5632ZEgtDcaB36H3MGR6vP2diiZMyKS/go-smux-yamux.(*stream).Read(0xc82a8b3ad0, 0xc822fdefe0, 0x20, 0x20, 0xc800000000, 0x0, 0x0)
    /home/kubuxu/go/src/gx/ipfs/QmZFdZY2Pjib1dT5632ZEgtDcaB36H3MGR6vP2diiZMyKS/go-smux-yamux/yamux.go:20 +0x4b
gx/ipfs/QmduCCgTaLnxwwf9RFQy2PMUytrKcEH9msohtVxSBZUdgu/go-peerstream.(*Stream).Read(0xc83e9bce00, 0xc822fdefe0, 0x20, 0x20, 0xc83d4b5f80, 0x0, 0x0)
    /home/kubuxu/go/src/gx/ipfs/QmduCCgTaLnxwwf9RFQy2PMUytrKcEH9msohtVxSBZUdgu/go-peerstream/stream.go:73 +0x6c
gx/ipfs/QmYT5cN3i8sg7HtwjiWJKybcfs6FvHL5zUoEJMdSuqR6GY/go-libp2p/p2p/net/swarm.(*Stream).Read(0xc83e9bce00, 0xc822fdefe0, 0x20, 0x20, 0x7f7aabfc51d8, 0x0, 0x0)
    /home/kubuxu/go/src/gx/ipfs/QmYT5cN3i8sg7HtwjiWJKybcfs6FvHL5zUoEJMdSuqR6GY/go-libp2p/p2p/net/swarm/swarm_stream.go:30 +0x4d
gx/ipfs/QmYT5cN3i8sg7HtwjiWJKybcfs6FvHL5zUoEJMdSuqR6GY/go-libp2p/p2p/metrics/stream.(*meteredStream).Read(0xc841cf6f40, 0xc822fdefe0, 0x20, 0x20, 0x22, 0x0, 0x0)
    /home/kubuxu/go/src/gx/ipfs/QmYT5cN3i8sg7HtwjiWJKybcfs6FvHL5zUoEJMdSuqR6GY/go-libp2p/p2p/metrics/stream/metered.go:37 +0x75
io.ReadAtLeast(0x7f7aac00eee8, 0xc841cf6f40, 0xc822fdefe0, 0x20, 0x20, 0x20, 0x0, 0x0, 0x0)
    /usr/lib/go/src/io/io.go:297 +0xe6
io.ReadFull(0x7f7aac00eee8, 0xc841cf6f40, 0xc822fdefe0, 0x20, 0x20, 0x0, 0x0, 0x0)
    /usr/lib/go/src/io/io.go:315 +0x62
gx/ipfs/QmYT5cN3i8sg7HtwjiWJKybcfs6FvHL5zUoEJMdSuqR6GY/go-libp2p/p2p/protocol/ping.(*PingService).PingHandler(0xc820011090, 0x7f7aac00ee40, 0xc841cf6f40)
    /home/kubuxu/go/src/gx/ipfs/QmYT5cN3i8sg7HtwjiWJKybcfs6FvHL5zUoEJMdSuqR6GY/go-libp2p/p2p/protocol/ping/ping.go:37 +0xc1
gx/ipfs/QmYT5cN3i8sg7HtwjiWJKybcfs6FvHL5zUoEJMdSuqR6GY/go-libp2p/p2p/protocol/ping.(*PingService).PingHandler-fm(0x7f7aac00ee40, 0xc841cf6f40)
    /home/kubuxu/go/src/gx/ipfs/QmYT5cN3i8sg7HtwjiWJKybcfs6FvHL5zUoEJMdSuqR6GY/go-libp2p/p2p/protocol/ping/ping.go:29 +0x34
gx/ipfs/QmYT5cN3i8sg7HtwjiWJKybcfs6FvHL5zUoEJMdSuqR6GY/go-libp2p/p2p/host/basic.(*BasicHost).SetStreamHandler.func1(0x7f7aac00ee80, 0xc841cf6f40, 0x0, 0x0)
    /home/kubuxu/go/src/gx/ipfs/QmYT5cN3i8sg7HtwjiWJKybcfs6FvHL5zUoEJMdSuqR6GY/go-libp2p/p2p/host/basic/basic_host.go:150 +0x83
created by gx/ipfs/QmYT5cN3i8sg7HtwjiWJKybcfs6FvHL5zUoEJMdSuqR6GY/go-libp2p/p2p/host/basic.(*BasicHost).newStreamHandler
    /home/kubuxu/go/src/gx/ipfs/QmYT5cN3i8sg7HtwjiWJKybcfs6FvHL5zUoEJMdSuqR6GY/go-libp2p/p2p/host/basic/basic_host.go:116 +0x490

I don't really have an idea how to tackle it, @whyrusleeping should take a look when he comes back.

Also those goroutines die out after some time so it isn't that big of a problem.

@Kubuxu Kubuxu added the help wanted Seeking public contribution on this issue label May 25, 2016
@whyrusleeping
Copy link
Member

relevant libp2p fixes here: libp2p/go-libp2p#58

@whyrusleeping
Copy link
Member

This has been addressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

2 participants