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

eth: fix shutdown regression to abort downloads, not just cancel #20988

Merged
merged 1 commit into from
Apr 27, 2020

Conversation

karalabe
Copy link
Member

Fixes #20975

I still managed to hang it once, but not general, so there might be something still in there, but at least most hangs are fixed.

@karalabe karalabe added this to the 1.9.14 milestone Apr 27, 2020
@karalabe karalabe requested a review from fjl April 27, 2020 08:24
@@ -222,7 +222,7 @@ func (cs *chainSyncer) loop() {

case <-cs.pm.quitSync:
if cs.doneCh != nil {
cs.pm.downloader.Cancel()
cs.pm.downloader.Terminate() // Double term is fine, Cancel would block until queue is emptied
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Terminate calls Cancel too... ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it closes a quit channel first so that intenral components know they need to die, not just not-restart

Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

eth hangs on shutdown if blocks are importing
2 participants