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/downloader: allow all timers to exit #21433

Merged
merged 1 commit into from
Aug 10, 2020

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Aug 10, 2020

There's an issue in statesync, which can cause the spindown to become blocked. Example trace:

goroutine 61 [select, 25 minutes]:
github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).spindownStateSync(0xc003576000, 0xc011a80c88, 0xc050990000, 0xf3, 0x100, 0xc15126c3c0, 0xc0ee278ae0)
        github.com/ethereum/go-ethereum/eth/downloader/statesync.go:226 +0x298
github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).runStateSync(0xc003576000, 0xc125033f40, 0x0)
        github.com/ethereum/go-ethereum/eth/downloader/statesync.go:131 +0x1002
github.com/ethereum/go-ethereum/eth/downloader.(*Downloader).stateFetcher(0xc003576000)
        github.com/ethereum/go-ethereum/eth/downloader/statesync.go:85 +0x47
created by github.com/ethereum/go-ethereum/eth/downloader.New
        github.com/ethereum/go-ethereum/eth/downloader/downloader.go:244 +0x433

The spindown path is via

        case <-s.done:
            d.spindownStateSync(active, finished, timeout, peerDrop)
            return nil

And, is s.done is closed, that means the timers may or may not fire at all. This PR removes the s.done-check from the timer func, so it always triggers.

Copy link
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

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

Let's spin the dice again

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.

2 participants