fix(tick): install cleanup trap early + break the rework crash-loop (igor#291) #294
No reviewers
Labels
No labels
Agent
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
joshtronic/igor!294
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/crash-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the crash-loop from logwatch igor#291 (#1+#2 of the night shift). The tick crashed (systemd
status=1, not OOM-137 -- 3.1G on a 31GiB host) mid-PR-rework on a Node repo with a heavy in-worktree test suite, then re-attempted every tick forever, starving the cascade.Two root causes, two fixes:
The crashlog gap --
#280s capture never fired becausetrap cleanup EXITwas installed after the early worktree-creating stages (maintenance, PR-rework, the claude call). A crash there ran with no handler. Movedcleanup()+ the trap to ~line 143-160 (right after the bot-identity exports) so every stage is covered; cleanup is a safe no-op on early/clean exits.The starvation loop -- a crash-safe rework counter (
.review[key].rework_crashes): stamp before the work, reset on a clean return, and after 2 crashes escalate to you (comment + unassign bot + assign reviewer) instead of looping.Honest note: the exact uncaught
set -eline is elusive from static reading (visible post-call code is guarded). Fix #1 means the next mid-rework crash gets preserved tocrash-logs/, handing us the stream to pin it -- fix #2 makes that non-urgent. No containment lever added (memory is not the cause; cgroup/systemd are off-limits).Verified:
bash -nclean, check-sync PASS, test-crashlog green. Reviewed by hand independently. No reviewer.