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

hang on shutdown caused by peer #583

Closed
dajohi opened this issue Dec 16, 2015 · 5 comments
Closed

hang on shutdown caused by peer #583

dajohi opened this issue Dec 16, 2015 · 5 comments

Comments

@dajohi
Copy link
Member

dajohi commented Dec 16, 2015

Perhaps @tuxcanfly can take a look.

Sending a SIGINT to btcd causes it to shutdown, and then it hangs after shutting down the block manager.

A trace shows thousands of these:

goroutine 3791753 [chan send, 280 minutes]:
main.(*server).peerHandler.func4()
        /home/dhill/.go/src/github.com/btcsuite/btcd/server.go:1739 +0x3f
created by time.goFunc
        /home/dhill/git/go/src/time/sleep.go:129 +0x3a
@tuxcanfly
Copy link
Contributor

Thanks, looking into it.

@jcvernaleo
Copy link
Member

I've hit this too once or twice (but always in a situation where I couldn't get much debug info).

@tuxcanfly
Copy link
Contributor

Trying to repro this but looking at the code I think it's an edge case where peerHandler is done but a new peer's OnVersion callback is fired. This would lead to hang on send to newPeers chan as it is no longer being received from peerHandler.

@jcvernaleo
Copy link
Member

I've seen it more on very slow machines if that helps you reproduce it.

@tuxcanfly
Copy link
Contributor

Thanks, will try that.

tuxcanfly added a commit to tuxcanfly/btcd that referenced this issue Dec 16, 2015
tuxcanfly added a commit to tuxcanfly/btcd that referenced this issue Dec 16, 2015
tuxcanfly added a commit to tuxcanfly/btcd that referenced this issue Dec 17, 2015
tuxcanfly added a commit to tuxcanfly/btcd that referenced this issue Dec 17, 2015
tuxcanfly added a commit to tuxcanfly/btcd that referenced this issue Jan 6, 2016
TheSusort pushed a commit to qchain/btcd that referenced this issue May 17, 2016
Also disconnect the failed peer to allow the peerDoneHandler goroutine
to exit, instead of hanging around. Fixes btcsuite#583.
alexlyp referenced this issue in alexlyp/dcrd May 24, 2016
Also disconnect the failed peer to allow the peerDoneHandler goroutine
to exit, instead of hanging around. Fixes decred#583.
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