Skip to content

Skip stale fs store artifacts#4618

Open
benthecarman wants to merge 1 commit into
lightningdevkit:mainfrom
benthecarman:fix-fs-store-list-artifacts
Open

Skip stale fs store artifacts#4618
benthecarman wants to merge 1 commit into
lightningdevkit:mainfrom
benthecarman:fix-fs-store-list-artifacts

Conversation

@benthecarman
Copy link
Copy Markdown
Contributor

The exhaustive filesystem store listing treated leftover temp and trash files as namespace directories after identifying them as non-keys. Skip those artifacts before recursing so migrations can ignore crash leftovers.

Caught by codex here: lightningdevkit/ldk-node#872 (comment)

@benthecarman benthecarman requested a review from tnull May 18, 2026 18:45
@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented May 18, 2026

👋 Thanks for assigning @tnull as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@ldk-claude-review-bot
Copy link
Copy Markdown
Collaborator

ldk-claude-review-bot commented May 18, 2026

Good — the Drop impl removes the entire data dir recursively, which includes the stale artifact files since they're placed inside temp_path (the store's data directory). Test cleanup is fine.

I've completed a thorough review of this PR. The changes are correct. My prior review already confirmed no issues, and this re-review concurs.

No issues found.

@benthecarman benthecarman force-pushed the fix-fs-store-list-artifacts branch from 190e458 to 4a1affd Compare May 18, 2026 19:13
@TheBlueMatt
Copy link
Copy Markdown
Collaborator

Please word-wrap your commit messages.

The exhaustive filesystem store listing treated leftover temp and trash
files as namespace directories after identifying them as non-keys.
Skip those artifacts before recursing so migrations can ignore crash
leftovers.
@benthecarman benthecarman force-pushed the fix-fs-store-list-artifacts branch from 4a1affd to 1b5475a Compare May 18, 2026 19:31
@TheBlueMatt
Copy link
Copy Markdown
Collaborator

I'm confused, do we ever actually write tmp directories? I thought we only did that for files as a part of the write-fsync-swap-fsync dance?

@benthecarman
Copy link
Copy Markdown
Contributor Author

benthecarman commented May 18, 2026

We're not creating/using tmp directories. The problem is we'd skip over tmp/trash files and then later think they were dirs (because they weren't keys) and try to go into it as if it were a dir

{
// Clean up any trash files lying around.
if ext == "trash" {
if p.extension().and_then(|ext| ext.to_str()) == Some("trash") {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've ended up short-circuiting this behavior, should we retain it (what are trash files anyway?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Claude trash files don't ever show up in windows so not really sure what this is meant for

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's delete it.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.53%. Comparing base (3d94ac7) to head (1b5475a).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4618      +/-   ##
==========================================
+ Coverage   86.42%   86.53%   +0.11%     
==========================================
  Files         158      159       +1     
  Lines      109324   109856     +532     
  Branches   109324   109856     +532     
==========================================
+ Hits        94484    95068     +584     
+ Misses      12300    12263      -37     
+ Partials     2540     2525      -15     
Flag Coverage Δ
fuzzing-fake-hashes 5.75% <28.57%> (+0.67%) ⬆️
fuzzing-real-hashes 23.16% <0.00%> (+0.38%) ⬆️
tests 86.20% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

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.

4 participants