Skip to content

afx tower start: surface the owner-guard refusal in the CLI instead of the generic 30s timeout (split from #1690 item 1) #1691

Closed

Description

@amrmelsayed

Split from #1690 (item 1 — the most urgent; items 2+3 stay there, coupled). Companion to the #1689 owner guard shipping in 3.3.4.

Problem

When the owner-lock guard refuses a second Tower, the daemon exits fast with a teaching error ("another Tower owns this DB — pid X, port Y; did you mean CODEV_AGENT_FARM_DIR?") — but afx tower start daemonizes, so the user sees only the generic "Tower server failed to respond within 30000ms" timeout, indistinguishable from the #1685 hang class. The guard's whole value is the teaching error; today it's only in tower.log.

Fix shape

The launcher (afx tower start's readiness wait) should:

  1. Detect the fast-exit case (spawned pid dies before readiness) and stop waiting immediately instead of burning the full 30s;
  2. Surface the daemon's refusal verbatim — read the tail of tower.log for the guard's error (or a purpose-written status/last-error file, whichever the lane judges sturdier) and print it;
  3. Distinguish the three launcher outcomes in output: started / refused-with-reason / timed-out-still-unknown.

Regression test: a held lock + afx tower start → non-zero exit with the teaching error on stdout/stderr within seconds, not 30s of silence.

Activity

  1. added
    area/tower
    on Sep 16, 2026
  2. amrmelsayed commented on Sep 16, 2026

    @amrmelsayed
    CollaboratorAuthor

    On it! Working on a fix now.

  3. added 3 commits that reference this issue on Sep 16, 2026
    2555dd1
    3d185a1
    d6ffc65
  4. added a commit that references this issue on Sep 17, 2026
    4543313
  5. added a commit that references this issue on Nov 18, 2026
  6. added a commit that references this issue on Nov 24, 2026
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

    area/tower

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions