A call whose connection drops is asked again of the strip-owner that comes back (AGT-88) #5

Merged
merge-queue merged 1 commit from redial-on-drop into main 2026-11-30 01:14:06 -08:00
Owner

Work package: AGT-88

A call to strip-owner now survives strip-owner restarting under it, as each of its own releases does. Before, the connection dropped and the call failed at once ("strip-owner didn't answer wait: ... forcibly closed by the remote host"), which ended four pull-request watch runs on 2026-11-29.

Removed

  • CallFor's inline send-and-read, and WaitWake's and Hold's own copies of it.

Added (redial.go, one place for every caller)

  • dial: sends the request and reads the answer. If the connection drops before the answer (EOF, reset or "forcibly closed", aborted, broken pipe; dropped, with Windows' Winsock and overlapped-I/O codes in drop_windows.go), it dials again, starting strip-owner the way connect already does (through records.Find, at Medium integrity only), and asks again. It keeps trying for RestartWithin (2 minutes) after the first drop, then fails with an error that names that limit.
  • Which methods are asked again, from strip-store's and strip-owner's handling of each:
    • Asked again: reads and waits (mark, wait, wake, landing, conversation, pr, ci). Also the writes whose repeat is a no-op: note upserts the PR's row; land marks the PR once and claims it only if nobody owns it, and strip-owner's handed queue is a map; own claims only an unowned PR; remote-wait adds the session to the PR's waiters once; account keeps only a newer reading. And changed, check-hold, and hold (a hold lasts as long as its connection, so it ended with the one that dropped).
    • Never asked a second time once the request went: give (the giver no longer owns it, so a repeat is refused), save (a compare-and-swap: a repeat is refused as stale and its caller would apply its change again), ask (each one is a new row), approval (it would file a second request with Nelson), rerun (it would run CI or a release again), and stop (the drop is the stop). These fail with an error saying the connection dropped after the request went, so whether it took effect is unknown.
    • A request that can't have reached strip-owner (the write failed before its closing brace) is sent again whatever the method.
  • A wait asked again is sent as mark for its repo, and ends with the new process's count. A restarted strip-owner counts events from zero, so the old seq means nothing to it, and events may have come in while nobody was listening. Ending the wait makes the caller (pull-request watch, work-item-management wait) read again and wait from a fresh mark. Sending the old seq again could match the new count by chance and sleep through the event the watch was waiting for.
  • Hold: a goroutine watches the hold's connection. If it drops while the caller still holds, the goroutine holds again on the new strip-owner. release lets go of whichever connection holds at that moment.
  • WaitWake goes through dial with no deadline, so a pr-wake hook waits again after a restart.
  • Tests (redial_test.go, a fake strip-owner on a socket of the test's own). Each of the first six fails on main:
    • a mark is answered, then the wait drops as the owner exits, the owner comes back and the wait succeeds;
    • a pr-wake wait across a restart;
    • a hold that is held again on the new owner, and released there;
    • a give that drops is reported and heard exactly once;
    • an owner that never comes back fails after RestartWithin with an error naming it, not before;
    • a drop followed by an error answer returns that answer and isn't asked a third time;
    • which errors count as a drop: tonight's Windows reset does, and a deadline or a bad answer doesn't.

Left alone

  • The first dial of a call (connect, its 5-second wait, and who may start strip-owner), the CallTimeout/CallFor timeout on each answer, the in-process UseLocal path, and the wire format.
  • A timeout, an answer, and an error answer (a refusal included) are never retried.

Callers (pr, pull-request, strip-owner, strip, tmux-strip, claude-pane, work-item-management) get this by taking up the release. agent-tools' own records copy, which at-home-tools still builds into the strip-owner, tmux-strip, claude-pane and work-item-management it ships, gets the same change in a separate PR.

Work package: [AGT-88](https://openproject.home.romaine.life/wp/AGT-88) A call to strip-owner now survives strip-owner restarting under it, as each of its own releases does. Before, the connection dropped and the call failed at once ("strip-owner didn't answer wait: ... forcibly closed by the remote host"), which ended four `pull-request watch` runs on 2026-11-29. **Removed** - `CallFor`'s inline send-and-read, and `WaitWake`'s and `Hold`'s own copies of it. **Added** (`redial.go`, one place for every caller) - `dial`: sends the request and reads the answer. If the connection drops before the answer (EOF, reset or "forcibly closed", aborted, broken pipe; `dropped`, with Windows' Winsock and overlapped-I/O codes in `drop_windows.go`), it dials again, starting strip-owner the way `connect` already does (through `records.Find`, at Medium integrity only), and asks again. It keeps trying for `RestartWithin` (2 minutes) after the first drop, then fails with an error that names that limit. - Which methods are asked again, from strip-store's and strip-owner's handling of each: - Asked again: reads and waits (`mark`, `wait`, `wake`, `landing`, `conversation`, `pr`, `ci`). Also the writes whose repeat is a no-op: `note` upserts the PR's row; `land` marks the PR once and claims it only if nobody owns it, and strip-owner's handed queue is a map; `own` claims only an unowned PR; `remote-wait` adds the session to the PR's waiters once; `account` keeps only a newer reading. And `changed`, `check-hold`, and `hold` (a hold lasts as long as its connection, so it ended with the one that dropped). - Never asked a second time once the request went: `give` (the giver no longer owns it, so a repeat is refused), `save` (a compare-and-swap: a repeat is refused as stale and its caller would apply its change again), `ask` (each one is a new row), `approval` (it would file a second request with Nelson), `rerun` (it would run CI or a release again), and `stop` (the drop is the stop). These fail with an error saying the connection dropped after the request went, so whether it took effect is unknown. - A request that can't have reached strip-owner (the write failed before its closing brace) is sent again whatever the method. - A `wait` asked again is sent as `mark` for its repo, and ends with the new process's count. A restarted strip-owner counts events from zero, so the old seq means nothing to it, and events may have come in while nobody was listening. Ending the wait makes the caller (pull-request watch, work-item-management wait) read again and wait from a fresh mark. Sending the old seq again could match the new count by chance and sleep through the event the watch was waiting for. - `Hold`: a goroutine watches the hold's connection. If it drops while the caller still holds, the goroutine holds again on the new strip-owner. `release` lets go of whichever connection holds at that moment. - `WaitWake` goes through `dial` with no deadline, so a pr-wake hook waits again after a restart. - Tests (`redial_test.go`, a fake strip-owner on a socket of the test's own). Each of the first six fails on main: - a mark is answered, then the wait drops as the owner exits, the owner comes back and the wait succeeds; - a pr-wake wait across a restart; - a hold that is held again on the new owner, and released there; - a `give` that drops is reported and heard exactly once; - an owner that never comes back fails after `RestartWithin` with an error naming it, not before; - a drop followed by an error answer returns that answer and isn't asked a third time; - which errors count as a drop: tonight's Windows reset does, and a deadline or a bad answer doesn't. **Left alone** - The first dial of a call (`connect`, its 5-second wait, and who may start strip-owner), the `CallTimeout`/`CallFor` timeout on each answer, the in-process `UseLocal` path, and the wire format. - A timeout, an answer, and an error answer (a refusal included) are never retried. Callers (pr, pull-request, strip-owner, strip, tmux-strip, claude-pane, work-item-management) get this by taking up the release. agent-tools' own `records` copy, which at-home-tools still builds into the strip-owner, tmux-strip, claude-pane and work-item-management it ships, gets the same change in a separate PR.
A call whose connection drops is asked again of the strip-owner that comes back (AGT-88)
All checks were successful
Suite release / module (pull_request) Has been skipped
Suite release / check-package (pull_request) Has been skipped
Suite release / build (none, ubuntu-latest) (ubuntu-latest, none) (pull_request) Has been skipped
Suite release / deploy-image (pull_request) Has been skipped
Suite default / scope (pull_request) Successful in 5s
Suite default / check-fetches (pull_request) Has been skipped
Suite go / check-test-linux (pull_request) Has been skipped
Suite go / check-services (pull_request) Has been skipped
Suite release / finalize (pull_request) Has been skipped
Suite go / check-format (pull_request) Successful in 6s
Suite go / check-test-windows (pull_request) Successful in 39s
merge-queue landed on main
Suite go / scope (pull_request) Successful in 5s
Suite release / scope (pull_request) Successful in 5s
Suite release / check-manifest (pull_request) Has been skipped
Suite release / reserve (pull_request) Has been skipped
Suite release / reused-checks (pull_request) Has been skipped
Suite release / publish (pull_request) Has been skipped
Suite release / deliver (pull_request) Has been skipped
Suite default / check-logs (pull_request) Successful in 5s
Suite default / reused-checks (pull_request) Successful in 4s
Suite release / check-build (none, ubuntu-latest) (ubuntu-latest, none) (pull_request) Has been skipped
Suite release / deliver-prune (pull_request) Has been skipped
Suite default / check-rules (pull_request) Successful in 5s
Suite go / reused-checks (pull_request) Successful in 4s
69c65ce384
merge-queue deleted branch redial-on-drop 2026-11-30 01:14:06 -08:00
Sign in to join this conversation.
No reviewers
No labels
queue
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
romaine-life/strip-protocol!5
No description provided.