Spend the maintenance interval between passes, not before the first - #49
Merged
Merged
Conversation
The field is documented as the pause between passes; the loop slept it at the top of the body, so a freshly started maintainer idled for one interval and a maintainer that did not live that long never ran a pass at all. The draining check stays at the top of the loop. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
Ran this here: Two things worth stating in the PR, since they're the actual trade-off:
|
brightsparc
added a commit
to introspection-org/walgit
that referenced
this pull request
Sep 12, 2026
Upstream main (tobi#42-tobi#45, tobi#49) plus the Azure and IRSA branches as updated for PRs tobi#50 and tobi#48, plus the store-plugin and notify-transport lines the production image was already built from (a6ce265). The two conflicts were additive: the Event Grid handshake test and its doc note now sit beside the loopback notify-transport test and its bullet. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T6UZ2AaFQ6m7xgdZKRyHEV
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.
Moves the
maintenance.intervalsleep from the beginning to the end of the loop body.maintenance.intervalcurrently sleeps before the first pass, causing newly started processes to sit idle for one interval. Ephemeral maintainers (e.g., serverless hosts or per-request containers) often terminate before executing any work without raising an error.Moving sleep to the end of the loop fixes this while keeping the drain check at the top.
Trade-off: Simultaneous restarts will no longer be staggered across the interval. Since leases/ guards heavy operations, this results in lock contention rather than duplicate work. I can put this behind a feature flag if default staggering is preferred.