Herder cleanup and hardening#5229
Merged
Merged
Conversation
bboston7
approved these changes
Apr 16, 2026
6 tasks
pull Bot
pushed a commit
to DIGIIX-Ltd/stellar-core
that referenced
this pull request
Apr 21, 2026
# Description Fixes a race in "persist publish queue" tests. Here is a diff to repro the original failure: ``` diff --git a/src/ledger/LedgerManagerImpl.cpp b/src/ledger/LedgerManagerImpl.cpp index b4dd5ee..5f1fc9a18 100644 --- a/src/ledger/LedgerManagerImpl.cpp +++ b/src/ledger/LedgerManagerImpl.cpp @@ -2934,6 +2934,7 @@ LedgerManagerImpl::storePersistentStateAndLedgerHeaderInDB( if (appendToCheckpoint) { + std::this_thread::sleep_for(std::chrono::milliseconds(2000)); mApp.getHistoryManager().appendLedgerHeader(header); } ``` I think this issue is from stellar#5229. We used to purge SCP state in `newSlotExternalized`, but now it get's called post apply. `while (hm1.getPublishSuccessCount() < 5)` was a bad check, since we could increment the published count before hitting the SCP message cleanup. I think the race existed for a while, but the most recent PR delayed cleanup, so it made it more likely to occur. The race seems like it's just in the test itself. # Checklist - [x] Reviewed the [contributing](https://github.com/stellar/stellar-core/blob/master/CONTRIBUTING.md#submitting-changes) document - [x] Rebased on top of master (no merge commits) - [x] Ran `clang-format` v8.0.0 (via `make format` or the Visual Studio extension) - [x] Compiles - [x] Ran all tests - [ ] If change impacts performance, include supporting evidence per the [performance document](https://github.com/stellar/stellar-core/blob/master/performance-eval/performance-eval.md)
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.
No description provided.