-
Notifications
You must be signed in to change notification settings - Fork 804
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
Clear correctly heal pending task before restart #3920
Conversation
Signed-off-by: Karim TAAM <[email protected]>
842631e
to
eb97fb4
Compare
Signed-off-by: Karim TAAM <[email protected]>
Signed-off-by: Karim TAAM <[email protected]>
Signed-off-by: Karim TAAM <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, please add a CHANGELOG entry
@@ -119,4 +119,32 @@ public void shouldSwitchToNewPivotBlockWhenNeeded() { | |||
verify(snapSyncState).setCurrentHeader(pivotBlockHeader); | |||
verify(fastSyncActions).waitForSuitablePeers(any()); | |||
} | |||
|
|||
@Test | |||
public void shouldSwitchToNewPivotOnlyOnCe() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/OnCe/Once/?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nah he meant Only on windows CE ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha. good catch
@@ -93,9 +93,9 @@ public void switchToNewPivotBlock(final BiConsumer<BlockHeader, Boolean> onSwitc | |||
LOG.info( | |||
"Select new pivot block {} {}", blockHeader.getNumber(), blockHeader.getStateRoot()); | |||
syncState.setCurrentHeader(blockHeader); | |||
lastPivotBlockFound = Optional.empty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is getting set in both check
and switchToNewPivotBlock
, perhaps we should use a final AtomicReference<BlockHeader>
instead of a mutable Optional<BlockHeader>
IDK if the snap pipeline might be calling these concurrently, but it seems possible.
any place where we would want to have Optional.empty(), we can just set the atomic reference to null, and when accessing we can wrap with Optional.ofNullable(listPivotBlockFound.get())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to find out if it was a problem but I don't think so. we could change it, but I'm afraid it might slow down the pipeline with additional synchronization.
if you find a case that could cause a crash or something, don't hesitate, I may have missed it. but from what I see. there is no risk. even if the value changes the behavior seems to remain valid
Signed-off-by: Karim TAAM <[email protected]>
please add a CHANGELOG entry |
Signed-off-by: Karim TAAM <[email protected]>
Signed-off-by: Karim TAAM <[email protected]>
49e4fd8 -> worldstate not avail (#4069) 6aa8812 -> stateroot mismatch (#4041) 043191a -> jwt auth on websockets (#4039) 90f891b -> do not move head on exec and propose (#4013) 3baa4da -> upgrade for websockets (#4019) 5024c07 -> sepolia TTD (#4024) 5ee9be8 -> heal step in snap (#3920) 261b1e0 -> remove peer block height requirements (#3911) Signed-off-by: garyschulte <[email protected]>
49e4fd8 -> worldstate not avail (#4069) 6aa8812 -> stateroot mismatch (#4041) 043191a -> jwt auth on websockets (#4039) 90f891b -> do not move head on exec and propose (#4013) b5fa62c -> sync check before processing remote transactions (4035) 3baa4da -> upgrade for websockets (#4019) 5024c07 -> sepolia TTD (#4024) 5ee9be8 -> heal step in snap (#3920) 261b1e0 -> remove peer block height requirements (#3911) Signed-off-by: garyschulte <[email protected]>
…r#3920) Signed-off-by: Karim TAAM <[email protected]>
Signed-off-by: Karim TAAM [email protected]
PR description
Properly clean the pending tasks when changing the pivot block in order to avoid blocking the snapsynnc process
Fixed Issue(s)
Documentation
doc-change-required
label to this PR ifupdates are required.
Changelog