Repository navigation
Done
Description
What's the problem
#4095 ships the core Tor auto-heal ladder for #4075 in 2.0.4:
- a rejected NEWNYM advances to the state reset;
- the healer gives up only after the last action's cooldown;
- non-saturation reset reasons;
- past the cap it probes and re-alerts hourly.
Four refinements from the 2026-11-14/15 incident on #4075 are not in it.
- No rung waits for circuits to stop completing. The control port's circuit readings only annotate the failure evidence. In the incident, windows with 1 to 84 completed circuits came before the Tor restart.
- The healer's
tor-historyread can collide with its own mutating action.tor-historyandtor-recoverboth take the host mutation lock withPITHEAD_LOCK_TIMEOUT=0, and so does the dashboard's Docker control. A refused read is logged as "refused or unavailable", with no distinct result. - Disruptive rungs are spaced only by the 30-minute
COOLDOWN_SEC. If relays rate-limit a fresh Tor's circuit creation for about an hour (hypothesis), a second disruptive rung 30 minutes after the first lands inside that window. - The KVM tor-heal legs block guard reachability. The incident had about zero connection failures: circuit-creates were dropped while the channel stayed open. The current legs do not reproduce it.
What it impacts
Appliance and DIY owners with Tor egress self-heal on (the default) during partial or relay-side Tor degradation:
- a disruptive rung can restart Tor while circuits are still recovering;
- a restart can land inside the relay defence window, so it does not help;
- a history read can be refused by the healer's own action, leaving the outage without a saturation reading.
How I found it
- The 2026-11-15 evidence comment on Tor auto-heal ladder: rejected NEWNYM must advance to state reset and Tor restart; detect saturation directly #4075 records a second Pithead instance on the operator's LAN, items 1, 3, 4 and 5 of "What the incident adds".
- The owner's 2026-11-16 ruling on Tor auto-heal ladder: rejected NEWNYM must advance to state reset and Tor restart; detect saturation directly #4075 moved these four to a v2.0.5 follow-up if Tor auto-heal: advance past a rejected NEWNYM to state reset and restart (#4075) #4095 was not green when the rest of the 2.0.4 cut was ready.
- The reviewer's round-3 note on Tor auto-heal: advance past a rejected NEWNYM to state reset and restart (#4075) #4095 asked for this issue to be linked.
Unknown: whether the relay circuit-creation defence explains the 62-minute 95% bootstrap stall. That is a hypothesis, and this issue's 60-minute spacing is the cheap test of it.
How important is it
Medium. The 2.0.4 ladder already recovers the 15 h wedge (#4045) and keeps alerting past the cap. These changes reduce wasted or harmful disruptive rungs during partial degradation, and make the evidence complete.
Acceptance criteria
- No disruptive rung (state reset or restart) is taken while the last control-port readings show circuits completing in the current outage. A unit test drives a completing-circuit reading and shows the rung is held.
- A
tor-historyread refused by the host lock is recorded as a distinct result, not "refused or unavailable". The healer does not request history while its own mutating action holds the lock. Both are covered by unit tests. - Disruptive rungs are at least 60 minutes apart, and NEWNYM rungs keep the 30-minute cooldown. A unit test asserts both spacings.
- A tier4-kvm tor-heal leg drops circuit-create cells while the guard channel stays open, and shows the ladder's behavior. The KVM drop-cells leg has a job id in the PR proof.
Possible solutions
- Gate the reset and restart rungs on the circuit-established flag plus completions-since-last-reading from the control port. Tor auto-heal: advance past a rejected NEWNYM to state reset and restart (#4075) #4095 already reads the flag and the pending count.
- Return a distinct
lock_refusedstatus fromtor-historywhen the lock is held, and skip the history request in the same round astor-recoveror a Docker stop. - Add
DISRUPTIVE_SPACING_SEC = 60 * 60besideCOOLDOWN_SECand apply it only to rungs past NEWNYM. - Add a KVM fault that drops outbound circuit-create cells (nft on the guest's Tor uid toward the guard) instead of blocking the guard address.
Related: #4075 (parent), #4095 (2.0.4 fix), #4045, #4261, #4121.
Activity
pithead-developer commentedon Nov 20, 2026
Blocked on #4075. I made no edits and opened no branch or PR for #4280 or #4283. Both issues extend the Tor heal ladder from PR #4095, which is still open, targets
develop, and is CONFLICTING. The #4095 code is not ondevelop-v2.0.5, so there is nothing to refine or fix there. I checked this branch'stor_heal.py: it has noNEWNYM_ATTEMPTS,_newnym_retried, state-reset rung or circuit-reading evidence, and a search for those names found nothing.What each issue needs:
except OSErrorrefund path that exists only in Tor auto-heal: advance past a rejected NEWNYM to state reset and restart (#4075) #4095's ladder. Its acceptance criteria name_newnym_retried,NEWNYM_ATTEMPTSand the exhausted state, none of which exist here.DISRUPTIVE_SPACING_SECrule applies to rungs past NEWNYM, and the base has no such rungs. Itslock_refusedchange touchestor_heal_history.pyand the host verbs, which could be done standalone, but it shares the same code and tests as the rest.This is blocked on #4075, which #4095 closes; it is open and in milestone v2.0.4. #4095 has to merge, and reach
develop-v2.0.5, before this branch can be written. I did not write the work against thedevelop-v2.0.5base: it would conflict with #4095 on the same lines and could not be tested against the ladder it modifies.To unblock, one of these has to happen:
develop-v2.0.5(owner or runner).Left untested: the KVM drop-cells leg for #4280 needs a
tier4-kvmjob on a head that includes the ladder. After the unblock, a singletier4-kvmtor-heal job can prove both issues.The runner resumes this issue when that one closes.
pithead-developer commentedon Nov 21, 2026
Questions before work continues (answer here, then remove the
questionlabel):#4095 is squash-merged into
develop(b6f3251), butdevelop-v2.0.5, the base I must branch from and target, does not contain it. The tip ofdevelopis 2 commits ahead ofdevelop-v2.0.5: #4095 and the unrelated #4314, the XvB host move. The latest forward merge intodevelop-v2.0.5(#4315) landed before #4095. The Tor ladder code (NEWNYM_ATTEMPTS, the state-reset rung) is therefore still absent from the base, so #4280 and #4283 cannot be written or tested against it. Can the runner or owner forward-mergedevelopintodevelop-v2.0.5, so I can branch from the base once it holds #4095? That is my default: no PR diff pulls in unrelated commits, and it needs no ruling. If a forward merge is not planned soon, may I instead mergeorigin/developinto this branch and keep targetingdevelop-v2.0.5? That would put #4314's commit in the PR diff, and a later forward merge would reconcile it. I will take the first option and resume when #4095 is on the base.pithead-architect commentedon Nov 21, 2026
Ruling: Don't wait, and don't merge
origin/developinto this branch. Nothing in the runner forward-mergesdevelopinto adevelop-v*line on its own. #4315 was a developer PR, so your default would wait with no trigger, and the second option would put the unrelated #4314 into this PR's diff. Do the forward merge yourself, the same way #4315 did it. (1) Make aforward/develop-into-develop-v2.0.5-<date>branch fromorigin/develop-v2.0.5and mergeorigin/developinto it with--no-ff. Today that brings in #4095 (b6f3251) and #4314. Open it againstdevelop-v2.0.5with the three-section body. Say in it that it must be merged with a merge commit, not squashed, and resolve any conflict as #4315 did: keep both sides, and split a file that goes over budget along a behaviour boundary, without raising a ceiling. (2) That PR goes through the normal review and the gates its touched paths require. You don't get to argue a waiver because the code is already ondevelop. (3) Returnblockedon that forward-merge PR. When it merges, branch #4280 fresh fromdevelop-v2.0.5and write the four refinements against the ladder as it is on the base. #4283 needs the same base, so mention in the forward-merge PR that it unblocks both.pithead-developer commentedon Nov 21, 2026
Blocked on #4325. Blocked on forward-merge PR #4325, which brings
develop(including the #4095 Tor ladder, b6f3251) intodevelop-v2.0.5. #4280 and #4283 refine that ladder, so they cannot be written or tested until #4325 is on the base. I opened #4325 as a draft againstdevelop-v2.0.5. It was merged with--no-ffon aforward/*branch, and its body says it must be merged with a merge commit and that it unblocks both issues. The one conflict was indocs/dev/file-budget.tsv: both sides added a ceiling row, so I kept both and raised no ceiling. Locally,pytest tests/service/healthpassed andlint-file-budgetwas OK. Thelint-pithead-buildself-test printed onlyoklines but exceeded my time limit, so I have no exit status for it and CI is the proof. I commented the blocker on #4325. The next session branches #4280 and #4283 fresh fromdevelop-v2.0.5and writes the four refinements and the #4283 fix against the ladder as it stands on the base. Both stay in one PR with one tier-4 tor-heal job. Nothing else has been written for either issue.The runner resumes this issue when that one closes.
pithead-developer commentedon Nov 27, 2026
Blocked on #4569. Blocked on #4569, the forward merge of
developintodevelop-v2.0.5that replaced my closed #4325. It is still open, andorigin/develop-v2.0.5still has noNEWNYM_ATTEMPTS, so the #4095 ladder that #4280 and #4283 extend is not on the base. I wrote nothing for either issue. I commented the blocker on #4569. When #4569 merges, the next session branches fresh fromdevelop-v2.0.5and does #4280 and #4283 in one PR with one tier-4 tor-heal job. Open PR #4399 (#4342) adds a KVM leg for refused circuit creates on an open channel. It may already cover #4280's drop-cells criterion, so check it before writing that leg.The runner resumes this issue when that one closes.
tests/os: tor-heal-dropcells phase drops circuit-create cells on an o…
pithead-developer commentedon Nov 28, 2026
Waiting on a transient bench_outage condition, not on another issue. The head's tier 1/2 GitHub checks have been queued since 03:59Z on a GitHub-wide Actions queue backlog; other branches' runs queue the same way. bench-submit holds tier4-e2e and tier4-kvm (exit 75) until they pass, so no bench job exists. Resubmit when
gh pr checks 4627shows green. The runner re-checks it (first at 2026-11-28T04:26Z, at most 5 times).tests/os: count every attempted disruptive rung, sample the open chan…
Tor heal: name the 30-minute cooldown before the first disruptive run…
Operations docs: the 60-minute gap precedes only the restart, not the…
pithead-developer commentedon Nov 30, 2026
Waiting on a transient bench_hold condition, not on another issue. bin/bench-submit refuses until GitHub CI is finished-green on head 35b44c5 (last rollup: 29 pass, 15 pending, 2 skipping). Resume action: if gh pr checks 4627 is fully green, run bin/bench-submit --repo pithead --tier tier4-e2e --commit 35b44c5 --ref agent/4280-tor-heal-refinements --base develop --option mode=targeted with a fresh --note, return waiting with the job id@commit, then paste the unedited evidence block into the PR proof section and answer F4627-7. If checks are still pending or red, re-evaluate; if a develop-base conflict appears (conflicts_with_base), apply the pinner merge from the private note first. The runner re-checks it every 15 minutes until the bench hold ends.
tor-heal: fix #4280, #4283 — circuit-completion gate, lock_refused hi…
pithead-developer commentedon Dec 1, 2026
Merged in #4627.