Repository navigation
fix(bin): skip the timed re-exec for idle fm-inactive-reconcile scans - #71
Merged
Merged
Conversation
Every watcher poll called fm-inactive-reconcile.sh scan, but about 59 of every 60 calls were not yet due under the 900s cadence gate. Each still paid for fm_run_timed's perl fork, a second bash+env re-exec of the script, and the scan lock before the cadence check (inside scan()) returned 0. The cadence is now checked with the existing scan_marker_age helper before any of that, so an idle, not-due call returns without the re-exec, perl, or the lock; ledger_pass still runs on every poll in a secondmate home, and a due call still falls through to the existing locked, timed scan unchanged. Measured on one idle poll with no pending work: 18 external process starts before (including the perl fork) down to 4 after. At a 15-second watcher cadence that is roughly 5,664 idle polls/day/home, each saving about 14 process starts, for about 79,000 fewer process starts per home per day.
ShellCheck's parser treated the bare done argument next to a backslash line continuation as the loop keyword. Quoting it matches the convention already used elsewhere in this file for the same reported_outcome_key call.
max-metaplanet
force-pushed
the
fm/proc-start-quickwins
branch
from
October 15, 2026 02:30
1d85d2f to
eef2b29
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bin/fm-inactive-reconcile.sh scanruns every 15-second watcher poll in every home, but its 900-second cadence gate was only checked after afm_run_timedre-exec (a perl fork on hosts with notimeout/gtimeout), a secondbash+envre-exec of$0 _scan-locked, and the scan lock. About 59 of every 60 calls were idle and paid for all of that for nothing.scan_marker_agehelper (builtins and file tests, no re-exec). An idle, not-yet-due call returns immediately without the timed re-exec, perl/timeout fork, or the lock.ledger_passstill runs on every poll in a secondmate home, the--startupbypass is unchanged, and a due call still falls through to the existing locked, timed scan unchanged.tests/fm-inactive-reconcile.test.sh::test_idle_not_due_poll_skips_timed_reexec, which shims whichever timed-exec mechanism the host has (timeout,gtimeout, orperl) and asserts a due call still invokes it, an idle not-due call does not, andledger_passstill delivers a secondmate's terminal ledger line on that same not-due poll.CI-validated marker
Local validation would have run a
no-mistakesTest step that selected a 28-script, 4-shard matrix (the full cross-cutting suite this change's selector resolved), which ran serially and quietly for 17+ minutes locally with no end in sight. Per the machine hold on this host (no heavy local builds, at most one heavy thing at a time), I stopped that local run, recovered the review step's fix already applied to this branch, and pushed directly so this repository's own parallel CI can validate instead. Thefm-ci-validatedlabel is applied at creation for that reason.Test plan
bash tests/fm-inactive-reconcile.test.shpasses locally (all cases, including the new one).bin/fm-lint.sh bin/fm-inactive-reconcile.shpasses.fm-ci-validatedso CI's own parallel run is the validation of record).