-
Notifications
You must be signed in to change notification settings - Fork 20.6k
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, les: wait for the downloads to be complete before stopping #16200
eth, les: wait for the downloads to be complete before stopping #16200
Conversation
Hmm, good catch on the issue. Regarding the solution, I'm wondering if we could reuse the already present |
@karalabe Yeah, that is a good idea. I guess I could just move Does that sound like a better approach?
|
1f48951
to
c7f4965
Compare
@karalabe updated the PR. |
@karalabe is there anything else that needs to be changed in this change? |
@karalabe is there anything else needs to be fixed in this review? |
@karalabe I just wanted to follow-up on this specific PR. It's been a while and we (at Status) still have this patch to keep our CI stable. It would be amazing to get more feedback on it and, if possible, to merge it upstream, so we can have one patch less for LES 😆 |
This PR touches some fairly "deep" internal stuff, hence why it's taking so long. Someone needs to review it properly, which will take quite some time. |
The underlying issue was finally resolved for eth.Ethereum in this recent PR: #20695 |
Closed this now because the PR was quite old and les has changed a lot since it was opened. |
When stopping a node, and the list of headers to rollback is full (in
downloader.go:1160
) the database might be closed before the rollback changes are written there.That causes the crashes like status-im/status-go#652 and might be a source of a potential data loss/corruption.
This PR adds a method to wait for the downloads to be actually processed before proceeding forward and closing the DB.