Skip to content

Self-hosted relay: first pairing on a new identity can miss its deadline under disk load #1961

Open

Description

@AbirAbbas

What happens

On a self-hosted relay (codeaf relay --store), the first device registration on a brand-new identity can miss the client's 20 s deadline when the disk is busy. This is the first PUT /v1/dir/devices, at pairing step 3c. The first write freezes the legacy directory, then imports it into the three local anchors, and each anchor makes durable commits. Under the same load, dev hit the deadline in 1 of 4 pairings and #1950 in 3 of 4. A retry pairs in about a second, and normal pairing takes 1–3 s. The hosted relay is not affected.

Replication

  1. Load the disk with stress-ng --hdd 2 --hdd-bytes 1G --timeout 600s, or any sustained fsync-heavy writer.
  2. Run make build.
  3. Run go test -tags e2e -run 'TestPairJourney' -count=4 -v ./internal/e2e/.
  4. Count the step 3c failures that end in context deadline exceeded.

Acceptance

Under the same load, TestPairJourney pairs on the first attempt at least as often as on dev. The fix could be:

  • making first-use anchor setup cheaper, for example batching its durable writes;
  • or completing it before the device request's deadline starts.

The deadline must not be raised to hide it. Step 3c of the journey must pass with the visible pairing confirmation, and must not need a manual retry.

Activity

  1. added
    bugSomething the code does that it should not
    area:remote--host, relay, pairing, enginehost, attachments
    sev:seriousWrong or missing behaviour a person meets in ordinary use
    on Nov 1, 2026
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

    area:remote--host, relay, pairing, enginehost, attachmentsbugSomething the code does that it should notsev:seriousWrong or missing behaviour a person meets in ordinary use

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions