fix: report retry interval in seconds, not minutes - #889
Conversation
`job_retry_failed_payments` logs "I run async every {} minutes" while
printing `payment_retries_interval`, which is seconds: the same loop
feeds it to `Duration::from_secs`, and README.md,
docs/STARTUP_AND_CONFIG.md and docs/LIGHTNING_OPS.md all document it
as seconds. With the default of 60 the job ticks once a minute while
claiming to tick once an hour.
That the unit is a slip rather than a convention is settled by
`job_update_rate_events` a few lines below: it also reports minutes,
but divides its seconds-valued interval by 60 first.
Found while checking whether the retry job had already passed over a
payout stranded in settled-hold-invoice on a live instance. The log
said the next tick was an hour away; it had in fact already run three
times.
Also correct "lighting" to "lightning" in the same string, so the one
line this touches is left without a known error in it.
No test accompanies this. The change is the wording of a log line and
there is no observable behaviour to assert.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan includes up to 2 reviews per rolling hour; 1 remains after this review. WalkthroughThe scheduler retry-job log now reports its configured interval in seconds. It also corrects “lighting” to “lightning.” No public declarations changed. ChangesScheduler logging
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This localized change corrects the retry interval and spelling in an operator-facing log message without changing runtime behavior; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
job_retry_failed_paymentsannounces its cadence in minutes while printing avalue expressed in seconds:
Two words change on that line:
minutes→seconds, andlighting→lightning.Why the code is right and the message is wrong
The unit is unambiguous everywhere else:
Duration::from_secs(interval);README.md:563—payment_retries_interval = 60 # seconds between retries;docs/STARTUP_AND_CONFIG.md:112— "Retry interval in seconds (default: 60)";docs/LIGHTNING_OPS.md:115—// Seconds between retries (default: 60);settings.tpl.toml:19ships60.So with the shipped default the job runs once a minute and reports once an
hour — a factor of sixty, in the direction that makes an operator wait.
What settles it as a slip rather than a local convention is
job_update_rate_events, eighty lines below in the same file:Same phrasing, same seconds-valued setting — but converted. Two sibling jobs,
one honoured the conversion and the other did not.
How it surfaced
While operating a live instance I needed to know whether the retry job had
already swept a buyer payout stranded in
settled-hold-invoice. The log lineimplied the next sweep was an hour off, so the natural reading was that
nothing had happened yet. Comparing timestamps showed it had run three times
in the preceding three minutes:
Sixty seconds apart. During an incident that is the difference between "the
retry has not been attempted" and "the retry has already been attempted and
did not fire", which are opposite conclusions about whether to intervene by
hand.
Testing
cargo test --bin mostrod— 1199 passed, 0 failed.cargo clippy --all-targets -- -D warnings— clean.cargo fmt --check— clean.No test is added: the change is the wording of a log line, with no observable
behaviour to assert. Asserting on log output would couple the suite to a
string without testing anything real.
Notes for the reviewer
test_lighting_settingsinsrc/config/mod.rs:184carries the samemisspelling. Left untouched — renaming a test is a different change from
correcting operator-facing output, and it belongs in whatever PR next touches
that module.
job_update_rate_eventscomputesinterval / 60with integer division, soan interval under 60 seconds would report
0 minutes. Out of scope here andnot currently reachable with the shipped defaults, but flagging it in case
you want it tracked.
Summary by CodeRabbit