Skip to content

Continuing a chat after its holder was killed takes 6–16 s before the first acquire #1985

Closed

Description

@AbirAbbas

What happened

This came from a real two-computer test on a LAN relay with real models:

  1. Computer B held a chat.
  2. B's TUI and engines were killed with kill -9. Its storage daemon survived.
  3. About 16 s later, computer A offered Continue … here?.
  4. Pressing alt+c on A gave Moved from mac in 15.6s on Private task copies (opt-in), frame hints through the Raft relay, and two-computer fixes #1944's candidate.

On dev at cf282ddc6 the same step took 5.8 s, and 45.5 s once just after a relay restart. Earlier dev rounds took
1.6–2.2 s. Moves between two live computers stay at 0.9–2.5 s.

The relay log puts about 9–10 s between A's object uploads (POST store/objects) and its first acquire, so the
time is spent on A, before the acquire.

Replication

Field.

  1. Pair two computers through a codeaf relay. Continue a chat on B.
  2. kill -9 only B's TUI and engine processes.
  3. Wait for <device> offline on A, press alt+c, and time from the key to the first POST …/acquire in the relay
    log.

Deterministic (no model). A keyless loopback measurement through the public Continuer.Take does NOT reproduce
the full delay. It gives a first acquire at 0.53 s on dev and 0.77 s with #1944. It does show two smaller things:

Neither alone explains the field gap. The missing phase still has to be measured in the field.

Where

  • Continuer.take, Continuer.retireHolder and releaseWithin in internal/syncsetup/take.go.
  • Taker.keepLocal, Taker.fetchAndAcquire and seedFrom in internal/handoff.
  • Fetcher.Fetch and Fetcher.Complete in internal/cellsync/fetch.go.
  • TaskWorkspaceTransferPlan in internal/session/workspace_transfer.go.

The fix

  • Measure each phase between the key and the first acquire: local capture, retirement, dirty and unpublished checks,
    kept-branch upload, fetch, staging and preflight.
  • Skip the whole-tree pre-acquire staging for a chat with no workspace plan.
  • Keep the incoming-workspace admission check before any lease or folder write.

Acceptance

  • Through the scripted terminal door:
    1. kill the other holder's processes;
    2. let its lease lapse;
    3. assert the first acquire comes within 2 s of alt+c;
    4. assert one continuation receipt, with the latest turn and files intact.
  • Also count whole-tree materializations, so faster hardware cannot hide duplicated work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions