Skip to content

Gateway failure paths: drain, WORKER_UNREACHABLE, reconnect rebuild, e2e #119

Closed

Description

@V3RON

Part of #115 (ADR 0005, requirements 9, 28–31, 35).

Scope

  • Drain: a drained worker keeps its leases and receives no dispatches; worker.drain-started / worker.drain-ended.
  • Uplink down: no dispatches; renew/release/exec for a lease on that worker fail with WORKER_UNREACHABLE (kind: "transport"); the gateway never guesses a lease is gone before the worker's lease.expired fact arrives after reconnect.
  • Request dispatched then uplink lost: the client sees WORKER_UNREACHABLE; a grant that landed lives on the worker until its TTL; the fleet-wide rule catches a retry once the index is rebuilt (the documented 409 → GET loop).
  • Gateway restart: workers reconnect on backoff; every view and the lease index are rebuilt; clients resume renewing.
  • Version skew: a worker outside the gateway's protocol range is incompatible in its view with both ranges, never dispatched to.
  • e2e: two fake-driver workers and a gateway in one process tree; lease through the gateway, kill a worker, drain the other, restart the gateway.
  • Handler suites against scripted uplinks and a manually-advanced Clock: dispatch order and pass-over, stale-view NO_CAPACITY, drained and disconnected workers, fleet-wide rule, lease id routing, reconnect rebuild.

Done when

  • The e2e above passes and no gateway code path can touch a device or release a lease the worker has not ended.

Activity

  1. added 20 commits that reference this issue on Sep 6, 2026
  2. V3RON commented on Sep 9, 2026

    @V3RON
    ContributorAuthor

    Implemented in PR #131 (gateway drain, WORKER_UNREACHABLE, and reconnect-rebuild failure paths with e2e coverage). Closing as done.

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