Skip to content

bb-app supervisor retries forever after another server takes its port #2993

Closed

Description

@Techno911

What happened

When a managed bb-app start server exits and another healthy bb server has taken the configured URL/port, the full-stack supervisor retries the server indefinitely (roughly once per second).

Each retry fails with EADDRINUSE, writes another uncaught-exception diagnostic, and leaves the first supervisor plus its host daemon alive. This can create sustained CPU/disk churn and two host daemons for one data directory.

Reproduction

  1. Start the managed full stack on the default data directory and port.
  2. Cause that managed server child to exit while leaving its supervisor/daemon alive.
  3. Start another healthy bb server on the same URL.
  4. Observe Restarting server / Server failed to restart and EADDRINUSE repeating indefinitely.

Expected

After the managed server child exits, the supervisor should probe the configured health URL. If another valid healthy server owns it, it should stop its own remaining daemon and exit cleanly rather than retrying forever.

Proposed regression coverage

A supervisor test where the server child exits and an injected occupancy probe returns true should assert:

  • no replacement server is spawned;
  • the supervisor resolves as stopped;
  • its daemon receives SIGTERM.

I have a local tested patch implementing this behavior in packages/bb-app/src/launcher.ts.

Activity

  1. added theissue type on Sep 3, 2026
  2. added
    host
    cli
    confirmed-repro
    on Sep 3, 2026
  3. bb-slop-cop commented on Sep 3, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

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

    cliconfirmed-reprohost

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions