Skip to content

[dev-session] Managed slot detection can report active listeners as stale sockets #441

@joelklabo

Description

@joelklabo

Observed

While validating #270, managed session allocation (NOSTRDEV_MANAGED_SESSION=1) reported:

Skipping slot 0: port 3001 has stale socket with no process owner

even when ports were actively bound by a live process.

Why this matters

This can block deterministic slot selection and cause pnpm dev:logs to exit in environments where process-owner inspection is incomplete/unreliable.

Repro

  1. Start listeners on 3001 + 4173 (for example via Node net.createServer).
  2. Run LOG_TAIL=0 BITCOIN_NETWORK=mainnet pnpm dev:logs without explicit PORT/DEV_SERVER_PORT.
  3. Observe stale-socket message and early exit instead of deterministic remap or next-slot claim.

Suggested follow-up

Harden owner-detection fallback logic when lsof/ownership resolution is inconclusive, so active listeners are not treated as stale sockets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions