~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

knotless.dev
1 collaborator

knotless 0.17.0 Latest 2 packages, 1 image

1
10

knotless-run: a queue pass that runs long says where it is

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/knotless:run/pass-logging

What changes

Each pass logs, and a long one says where it is. knotless-run logs every reconcile pass over a repository as pass ended, with repo, status (ok or failed) and duration_ms: at debug, or info when it took KNOTLESS_SLOW_MS or longer. A pass records the stage it is at as it goes (reading the repository, running pulls, reading the queue, syncing the mirror, checking pre-flights, stacking a batch, launching a batch, landing a batch, ejecting a pull, pruning checks, and a few more), and a watchdog logs pass running long at warn, with repo, stage and duration_ms, once a pass has gone 5 minutes and again every 5 minutes while it goes on. The threshold is Options::watchdog, which a test shrinks.

Slow git commands are logged as slow HTTP calls are. Every git subprocess logs git (target knotless::git) with command (the subcommand), path and duration_ms: at debug, or warn past KNOTLESS_SLOW_MS. No timeout is added.

A failure going on is logged now and then. failed logs a repository's error the first time it is seen, then the same error only once a minute, with count, the times seen meanwhile. Another error logs at once, as does the same one after any of the repository's work succeeds, or once it has not been seen for an hour. The deleted space private-test logged SpaceDeleted every few seconds for hours.

Why

For The runner stopped landing the merge queue for 13 minutes, until restarted: the merge queue's pass for chadtmiller.com/knotless hung for 13 minutes with nothing in the logs saying where. No HTTP call was slow, so it was likely a git command, a lock or a run permit. This makes the next hang say which stage it is in and whether a git command is slow; it does not fix the hang.

How it was checked

Unit tests: git_commands (knotless telemetry, both levels), failures_going_on_are_logged_now_and_then (the repeat rule, against given instants), the runner's notes and a_long_pass_is_watched (the watchdog firing, and a quick pass passing through). a_merge_queue_goes_on_by_itself runs the queue with a 5 ms watchdog. Clippy on knotless and knotless-run here; tests and coverage left to CI.

Shortcomings

Failures are collapsed by repository and error text: an error whose text changes each time (a duration in it, say) is still logged each time. A success of any of a repository's work (a notice, a poll) clears its failures, so a pass failing while notices succeed logs as often as they succeed. The stage is the last one entered, so a pass hung in a stage's later reads shows that stage.

🤖 Generated with Claude Code

Merged as de4b9f6