Repository navigation
Poller: step timeouts so a hang fails the run; status.py --live alerts on timeouts and a missing bot-state branch - #65
Conversation
… a missing bot-state branch Follow-up to #61 (closed). Its review found that the poller's long cancelled runs were hangs, not concurrency noise: 209 of its 210 cancelled runs lasted 30 minutes or more, the job's timeout. A job timeout ends the run as cancelled, and status.py skipped every cancelled run, so five hung ticks in a row left a silent "CI ?". - wikidata-poll.yml: Install pinned Claude CLI and Clone mathlib4 get a 10-minute step timeout and Poll tick (apply) 20 minutes, inside the job's 30. The runner marks a step that hits its own timeout as failed, so a hang ends the run as a failure instead of a cancellation, with time left for Commit poll state. bot/README.md lists the message, and a wiring test keeps the step timeouts below the job's. - status.py ci_gate reads 20 runs with startedAt/updatedAt. A cancelled run that lasted 25 minutes or more counts as timed out and alerts; that covers older runs and hangs in the steps without a timeout of their own. When no listed run qualifies it alerts instead of printing a silent "CI ?". - batch_pr: a failed read is an alert, not only a "gh unavailable" line. - live_section: since #48 the bot-state branch is mandatory, so its 404 is an alert that points at the one-time bootstrap_state dispatch and bot/README.md 'Restore failed'. A second read, only on a 404, tells a missing branch from a branch without bot_state.json; the latter is reported as unreadable state and the batch PR is not checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Ready to merge after one timeout change and a wording fix (reviewed at Posted by the WikiLean PR swarm (lead); updated 2026-10-17. |
|
Verdict: merge after one small fix. The
|
|
Recommendation: merge (at
Optional: with the job limit at 60, Posted by the WikiLean PR swarm (lead); updated 2026-10-17. |
The 20-minute Poll tick limit was shorter than a batch open takes. In 2026-08 the 30-minute job limit cancelled 200 of 221 batch-open ticks while bot/refresh_tagged.py was still running, and the 21 that got past it spent 19 to 30 minutes in the tick step. A step limit under 30 would have failed every one of them. The job limit goes to 60 minutes and Poll tick to 50, so a step timeout still fails the run before the job limit cancels it, with time left for Commit poll state. Settle and conflict ticks are unaffected. status.py's 25-minute threshold still catches job-limit cancellations, which now last 60 minutes or more; only its comment changes.
|
Pushed
Edit: |
…atching The August cancellations were batch opens still inside refresh_tagged.py, not hangs, and dispatching again only repeats the slow refresh. The README bullet now says to read the step's last line first and names the refresh case. The matching test docstring drops "hung".
Poller: step timeouts so a hang fails the run; status.py --live alerts on timeouts and a missing bot-state branch
|
Re-review on main ( First: the poller has been down since 2026-10-14. Every scheduled run since (latest: 39093078411) fails in about 20 s at Follow-ups:
Checked and fine:
|
Follow-up to #61 (closed). The review of #61 found the timeout blind spot this PR fixes. 209 of the poller's 210 cancelled runs lasted 30 minutes or more: they were ticks killed by the job's
timeout-minutes: 30, not runs the concurrency group dropped. A job timeout ends a run ascancelled, and both #61's checker andmanage/status.pyskipped every cancelled run. Replayed on the 2026-08 stall, five timed-out ticks in a row fillstatus.py's five-run window, and--liveprints a silentCI ?with no alert. As both reviewers asked, this PR keeps a single engine (manage/status.py) and fixes the problem at its source.Changes
.github/workflows/wikidata-poll.yml: step-level timeouts on the long steps:Install pinned Claude CLI: 10 minClone mathlib4: 10 minPoll tick (apply): 50 minThe job limit goes from 30 to 60 min. A batch open spends most of its tick in
bot/refresh_tagged.py: in 2026-08 the 30-minute limit cancelled 200 of 221 batch-open ticks while it was still running, and the 21 that got past it took 19 to 30 minutes in the tick step.timeout-minutesas failed ("The action '…' has timed out after N minutes."). Only the job-level limit producescancelled. So a hang now ends the run as an ordinary failure.Poll tick (apply)was the step running when the job limit hit. The steps before it take about a minute and the steps after it a few seconds, so a timed-out tick still leaves time forCommit poll state(always()) inside the job limit. Settle ticks take under 2 minutes.bot/README.md("A poller run is red") lists the new message.bot/test_state_branch.pykeeps each of these step timeouts below the job's.manage/status.pyci_gatelists 20 runs (was 5) and readsstartedAt,updatedAt.cancelledrun that lasted 25 minutes or more counts as a red run:wikidata-poll run N timed out (cancelled after 31 min). This still matters after the workflow change, for older runs and for hangs in steps without their own timeout. Short cancellations andskippedruns are still passed over.no finished wikidata-poll run on main (…); the gate is unknown) instead of a silentCI ?.batch_pr: a failedgh pr viewnow raises an alert (could not read batch PR #N (…); its merge state is unknown), where before it only printed agh unavailableline.live_section/ci_bot_state: since Make the wikidata poller fail closed #48, thebot-statebranch is mandatory.bootstrap_statedispatch, which applies only if the branch never existed, and otherwise at bot/README.md "Restore failed".branches/bot-state) tells a missing branch apart from a branch that lacksbot/state/bot_state.json. The second case is reported as unreadable state, and the batch PR is not checked (the same handling as other read failures).gh run listand for non-404 bot-state read failures are unchanged.Testing
manage/test_status.py: 25 passed. Three tests are new: long-cancelled runs count as timeouts, the no-qualifying-run alert, and the missing bot-state branch alert. Three are updated to cover the batch-PR read failure, the 20-run listing fields, and the branch-without-file and branch-read-failure cases. Against main'sstatus.py, six of them fail.bot/test_state_branch.py(19) andbot/test_poll.py(43) pass. Both parse the workflow.scripts/ci-python.sh: every check passes except the Brain activation integration test, which needs Node 22 and fails only in a local environment with a different Node version. The checks after it were run one by one and pass.live_sectionagainst GitHub today: it now shows the missing-branch alert next torun … ended 'failure'. Replaying the 2026-08-16 run listing givestimed out (cancelled after 52 min)where main gave a silentCI ?.Notes
status.pyis a local operator tool.merge-conflictlabel alert to when GitHub's mergeable state is notMERGEABLE.bootstrap_statedispatch createsbot-state(see bot/README.md). Also confirm that GitHub Actions failure notifications reach the account that owns the schedule. The SessionStart hook runsstatus.pywithout--live, so those emails are the only unattended signal.🤖 Generated with Claude Code