Skip to content

Async background processor check_sleeper refactor - #3978

Merged
TheBlueMatt merged 2 commits into
lightningdevkit:mainfrom
joostjager:remove-bg-macro-follow-up
Jul 31, 2025
Merged

Async background processor check_sleeper refactor#3978
TheBlueMatt merged 2 commits into
lightningdevkit:mainfrom
joostjager:remove-bg-macro-follow-up

Conversation

@joostjager

Copy link
Copy Markdown
Contributor

This makes it impossible to forget to reinitialize the sleeper and poll a future that is already ready.

This makes it impossible to forget to reinitialize the sleeper and poll
a future that is already ready.
@ldk-reviews-bot

ldk-reviews-bot commented Jul 31, 2025

Copy link
Copy Markdown

👋 Thanks for assigning @TheBlueMatt 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.

@codecov

codecovBot commented Jul 31, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.65517% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.90%. Comparing base (664511b) to head (d91575d).
⚠️ Report is 5 commits behind head on main.

Files with missing linesPatch %Lines
lightning-background-processor/src/lib.rs89.65%3 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #3978 +/- ##
==========================================
- Coverage 88.91% 88.90% -0.01% 
==========================================
Files 174 174 Lines 124232 124230 -2 Branches 124232 124230 -2 ==========================================
- Hits 110455 110447 -8 - Misses 11301 11303 +2 - Partials 2476 2480 +4 
FlagCoverage Δ
fuzzing22.61% <ø> (ø)
tests88.73% <89.65%> (-0.01%)⬇️

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.

@joostjager
joostjager marked this pull request as ready for review July 31, 2025 13:39
Rustfmt is not always processing macros.
Comment on lines +950 to +956
let prune_timer = if gossip_sync.prunable_network_graph().is_some() {
NETWORK_PRUNE_TIMER
} else {
FIRST_NETWORK_PRUNE_TIMER
};
let prune_timer_elapsed = {
match check_sleeper(&mut last_prune_call) {
match check_and_reset_sleeper(&mut last_prune_call, || sleeper(prune_timer)) {

@elnoshelnoshJul 31, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

wouldn't this cause the first prune after 60s to not run in the GossipSync::P2P case? since it will override last_prune_call with sleeper after NETWORK_PRUNE_TIMER.

Edit: ignore, it won't.

"Error: Failed to persist scorer, check your disk and permissions {}",
e,
);
log_error!(logger, "Error: Failed to persist scorer, check your disk and permissions {}", e);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this similar log msg from the async version can be fixed as well

@TheBlueMattTheBlueMatt left a comment

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.

Straightforward cleanup.

@TheBlueMatt
TheBlueMatt merged commit d3dd617 into lightningdevkit:mainJul 31, 2025
24 of 25 checks passed
Sign up for freeto 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

@joostjager@ldk-reviews-bot@TheBlueMatt@elnosh