Skip to content

Remote lanes are torn down when the client is offline for a few minutes (reboot), running work lost #379

Closed

Description

@fen89

What happened

A worktree lane runs on a pool node (devstack up --on <node>): a long-running game server in Compose (database + server + a few helpers) that keeps simulated matches going for hours. The client machine that started the lane was rebooted (Windows restart, a few minutes offline).

When the client came back, the node had no containers of that lane left at all (docker ps -a on the node showed none, not even stopped ones), and devstack pool listed no lease for it. The node itself did not restart. All eight lanes of this client on that node were gone the same way; every running match inside them was lost.

devstack up --on <node> in each worktree brought the lanes back on the same slots, with their volumes (database, builds) intact, so data survived. Only the running state was lost.

Why (as far as I can see)

The node's leases.json has an expires per lease about two minutes ahead of now, so I assume the client renews it by heartbeat and the node tears a lane down once its lease expires. A client that is offline for longer than that (reboot, sleep, network change) loses every remote lane it started.

Expected

For lanes on a node, the work there should be able to outlive a short absence of the client: the services keep running while the client is away, and the client re-attaches (port forwards, status) when it is back. Losing all remote lanes on every client reboot makes nodes unsuitable for long-running jobs (load tests, simulations, overnight runs), which is one of the main reasons to put a lane on a node.

Ideas, any of these would do:

  • a much longer grace period before an unrenewed lease is torn down (or a configurable one per stack or lane),
  • a "detached" lane mode: devstack up --on <node> --detached keeps running until devstack lane stop,
  • at least: stop the containers instead of removing them, so a later up resumes them.

A side effect worth a look: right after the reboot the pool's offer on the node was lower than before (another member's lanes had taken the room), so two of the eight lanes could not be started again at all ("offers 1.1 CPU, the lane needs 2.7 CPU"), although they had been running there minutes before.

Environment

  • devstack 0.30.0 on the client (Windows 11), node runs 0.30.0 (Linux)
  • lanes started with devstack up --on <node> from git worktrees; Compose-only stack (no native services)
  • client daemon log has no entry for the teardown (the client was off); the node's lease record fields: admitted, disk, expires, id, kept, lane, member, need, repo, slot, stack_file

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