Skip to content

A new lane's offset lands on ports another stack forwards for its lane on a node #535

Closed

Description

@fen89

What happened

Two repositories on one Windows machine, each with its own stack (A and B), devstack 0.46.0 here (pool node and coordinator on 0.47.0).

  • Stack A runs a lane on a pool node with offset +400; its ports are forwarded to this machine, so this machine's daemon of stack A listens on A's main ports + 400 (here: two services, ports P and P+1).
  • In stack B (main ports 400 lower than A's, so B + 200 = P), a new git worktree add, then devstack up --on local in it. The lane got offset +200, which lands exactly on those forwarded ports.
  • up did not refuse up front. The seed job ran, then:
api                    failed: port P is already in use by another process (devstack.exe, pid …)
api-e2e                failed: port P+1 is already in use by another process (devstack.exe, pid …)
web                    failed: not started: `api` failed

The process holding them is stack A's daemon (devstack.exe daemon -f <repo A>/devstack.toml), i.e. the forwarder of A's lane on the node.

Expected

#387 point 3: every allocation (shift, lane number) avoids the ports other registered stacks claim, lane ranges included. The claim of a lane running on a node and forwarded here seems to be missing from that (or B's lane number was picked without it).

Failing that, up should stop before building and name the other stack, as it does for main-against-main ("the stack <other> … runs on ").

Why it hurts

The only way out today is --shift, which works only in the main tree: devstack down there, devstack up --shift auto (which also starts the main tree's services the user had stopped), stop those again, then the lane, and at the end down + up --shift none to get the ports back. Five steps to move one lane.

Proposal (any of)

  1. Count forwarded ports of lanes on nodes as claims, and give a new lane the next free offset (+300, ...).
  2. A per-lane offset choice in the worktree (devstack up --offset <n> or --shift for a lane) that leaves the main tree alone.
  3. At least: refuse at the start of up with the other stack's name and the ports, instead of failing service by service after the build.

Activity

  1. fen89 commented on Nov 16, 2026

    @fen89
    MemberAuthor

    Where this sits: #387 introduced the claims, built in #401. Its "Not verified" list names this case: "a lane on a pool node beside a shifted main tree ... not run end to end". Here stack A's main tree is not shifted, but its lane runs on a node and its forwarded ports were not avoided.

    The lane of stack B was new (worktree created minutes before), so the rule "a lane keeps its number" from #401 does not apply: free_number should have skipped +200. Likely candidates: the claims of stack A do not include the range of its lane on a node (forwarded ports), or they were not refreshed when that lane started.

  2. 7schmiede commented on Nov 16, 2026

    @7schmiede
    Member

    🤖 Fixed by #538 and #540.

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