Skip to content

fix(das): don't store an empty checkpoint when Stop can't get one - #5306

Open
kriss39 wants to merge 2 commits into
celestiaorg:mainfrom
kriss39:fix/das-stop-keep-checkpoint
Open

kriss39 wants to merge 2 commits into
celestiaorg:mainfrom
kriss39:fix/das-stop-keep-checkpoint

Conversation

@kriss39

@kriss39 kriss39 commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Closes #5305

Stop now only writes the early checkpoint when getCheckpoint succeeds. If it fails, the error is logged and the checkpoint already on disk is left alone, instead of being replaced with an empty one. The rest of Stop is unchanged: the final checkpoint is still written after the sampler and workers have shut down.

The new test stores a checkpoint at the synced head, calls Stop with a canceled context and checks the stored checkpoint afterwards, 20 times since getCheckpoint only fails when the select picks ctx.Done(). On main it fails with SampleFrom: 0, NetworkHead: 0; with this change go test -race ./das/... passes.

When the Stop context is already done, getCheckpoint can return an error and an
empty checkpoint, which Stop then wrote over the stored one. Skip that write so the
last stored checkpoint stays in place.
@kriss39
kriss39 requested a review from a team as a code owner September 30, 2026 19:57
@github-actions github-actions Bot added the external Issues created by non node team members label Sep 30, 2026
@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 37.48%. Comparing base (42addd6) to head (92f5431).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
das/daser.go 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5306      +/-   ##
==========================================
- Coverage   37.52%   37.48%   -0.04%     
==========================================
  Files         321      321              
  Lines       22323    22322       -1     
==========================================
- Hits         8376     8367       -9     
- Misses      12922    12932      +10     
+ Partials     1025     1023       -2     

☔ View full report in Codecov by Harness.
📢 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.

@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Fixes checkpoint storage logic in shutdown sequence.

No outstanding findings prevent merging.

What we checked:

  • Later test runs time out: No. The helper creates a new timed context for every run.
Summary

The PR leaves the stored checkpoint alone when Stop cannot get an early checkpoint. Each test run now has its own deadline, addressing the earlier test concern.

Reviews (2) · Last reviewed commit: "test(das): give each canceled-Stop run i..."

Comment thread das/daser_test.go Outdated

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external Issues created by non node team members

Projects

None yet

Development

Successfully merging this pull request may close these issues.

das: Stop overwrites the stored checkpoint with an empty one when its context is done

1 participant