Skip to content

fix: Flush buffers before renaming cache file#2927

Merged
kuznetsss merged 1 commit intoXRPLF:developfrom
kuznetsss:Fix_cache_saving
Jan 22, 2026
Merged

fix: Flush buffers before renaming cache file#2927
kuznetsss merged 1 commit intoXRPLF:developfrom
kuznetsss:Fix_cache_saving

Conversation

@kuznetsss
Copy link
Collaborator

If clio shuts itself down due to exceeding graceful period when cache is saved and renamed but the buffers are not flushed, we may end up with a corrupted cache file. Clio will detect corruption and will not load corrupted cache file, but we could avoid it by explicitly flushing ofstream buffer.

@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

❌ Patch coverage is 42.85714% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.02%. Comparing base (a72e5a1) to head (5a05813).
⚠️ Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
src/data/impl/LedgerCacheFile.cpp 0.00% 1 Missing and 1 partial ⚠️
src/data/impl/OutputFile.cpp 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2927      +/-   ##
===========================================
- Coverage    82.04%   82.02%   -0.02%     
===========================================
  Files          391      391              
  Lines        14623    14630       +7     
  Branches      8001     8005       +4     
===========================================
+ Hits         11997    12000       +3     
- Misses        1447     1449       +2     
- Partials      1179     1181       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kuznetsss kuznetsss merged commit 59d07fa into XRPLF:develop Jan 22, 2026
28 checks passed
@kuznetsss kuznetsss deleted the Fix_cache_saving branch January 22, 2026 11:44
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