fix: bound and parallelise the queue-time join - #58
Merged
Merged
Conversation
`stats --queue` made one serial API call per unique run with no bound and no output, so on a machine with real history it did not finish and looked identical to a hang. Observed at 1821 calls, killed at ten minutes. The join now covers the last 7 days by default, with `--days N` to widen or narrow it and `--all` for no limit, and runs its calls in parallel (`RUNPOOL_JOIN_JOBS`, default 8). It reports how many runs it is fetching before it starts and marks each one off, so a long join is legible rather than silent. 740 runs now complete in about a minute. Also documents what was already true but unwritten: the pools file is intent, the running pool is state, and `apply --dry-run` is where the two are reconciled. `set-count` deliberately does not write the file, so they disagree after every resize, and that is the design rather than drift to repair. Closes #56 Closes #57
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.
What
runpool stats --queuemade one serialgh apicall per unique run, with no bound and no progress output. On this machine that was 1821 calls; killed at ten minutes, still running, having printed a single line. A command that is working and a command that is stuck looked the same.Closes #56, closes #57.
Changes
--days Nwidens or narrows it,--allremoves the limit. A run outside the window is dropped before it can cost a call.RUNPOOL_JOIN_JOBS). Each worker writes its own file rather than a shared pipe, because concurrent writers interleave mid-line and a torn row would silently corrupt the join.apply --dry-runreconciles them.set-countdeliberately does not write the file, so they disagree after every resize. That was already the design; it just was not written down.Measured
--days 1)Tests
New
tests/stats-queue-window.sh, offline with a stubbedgh. Covers the window actually cutting API calls, the default staying bounded, the progress reporting, and flag validation on both entry points. Verified it fails when the default is made unbounded again.All five suites pass;
shellcheck --severity=warningandbash -nclean.