Skip to content

Herder cleanup and hardening#5229

Merged
marta-lokhova merged 3 commits into
stellar:masterfrom
marta-lokhova:herderCleanupApr
Apr 16, 2026
Merged

Herder cleanup and hardening#5229
marta-lokhova merged 3 commits into
stellar:masterfrom
marta-lokhova:herderCleanupApr

Conversation

@marta-lokhova
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings April 16, 2026 21:46
@marta-lokhova marta-lokhova requested review from bboston7 and removed request for Copilot April 16, 2026 21:48
@marta-lokhova marta-lokhova enabled auto-merge April 16, 2026 22:27
@marta-lokhova marta-lokhova added this pull request to the merge queue Apr 16, 2026
Merged via the queue into stellar:master with commit 94d3368 Apr 16, 2026
71 checks passed
@marta-lokhova marta-lokhova deleted the herderCleanupApr branch April 16, 2026 23:14
@SirTyson SirTyson mentioned this pull request Apr 21, 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)
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