[Fix] Make the validators dump their block tree correctly#4234
Open
[Fix] Make the validators dump their block tree correctly#4234
Conversation
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
vicsn
reviewed
Apr 27, 2026
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
Collaborator
Author
|
I've updated the PR - now no zombie tasks are expected to exist at shutdown, and if any are found, an |
kaimast
reviewed
Apr 30, 2026
|
|
||
| /// Shuts down the REST instance. | ||
| pub fn shut_down(&self) { | ||
| self.handles.lock().iter().for_each(|handle| handle.abort()); |
Contributor
There was a problem hiding this comment.
It doesn't matter as much but using drain(..) would also drop the handles when calling shut down.
kaimast
reviewed
Apr 30, 2026
| /// Wake up the ping task so that its inner loop iterates and breaks. | ||
| /// It should only be called after the ledger has already been stopped. | ||
| pub fn stop(&self) { | ||
| self.notify.notify_one(); |
Contributor
There was a problem hiding this comment.
Can't we just abort the ping task here?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
Dropimpl of theLedgeris what causes the block tree to be cached on shutdown. As long as there are any "zombie tasks" which hold a reference to the ledger post-shutdown, that impl won't fire, forcing the node to fully rebuild the block tree on startup (or to report an invalid cached block tree if it's old, as it was reported in the linked issue).This was debugged using
tokio-console. I've also considered downgrading some of theLedger-relatedArcs toWeak, but sadly, that would result in aResultpocalypse. That being said, it is perfectly fine to useArceverywhere (like we do now), as long as we make sure that the persistent tasks that own them are terminated during shutdown.Fixes #4227.