Skip to content

fix(daemon-client): timeout reset clears daemon.json and daemon.lock without proving ownership #3105

Description

@thymikee

Problem

The daemon-client timeout reset path in src/daemon-client/daemon-client-timeout.ts (resetDaemonState, around line 191) unlinks daemon.json and daemon.lock without proving that this client's daemon is the process those files describe. It is the client-side twin of #3087: a client giving up on a slow daemon deletes the metadata of a daemon that is alive and simply busy, or of a successor that took over meanwhile.

Direction

Route the cleanup through the same fence the daemon uses — readRegisteredDaemonOwnership for the info file, and the existing liveness proof for the lock — and decline with a typed reason instead of unlinking. Client cleanup is what makes an absent record normal for the daemon at exit, so this path must stay fail-closed rather than simply deleting less.

Refs #3087, #3102

Activity

  1. thymikee commented on Oct 4, 2026

    @thymikee
    MemberAuthor

    Implemented and verified on main in #3127 (merge 2212eacf5b). Timeout reset now awaits the central stopAndRetireDaemon operation: verified process lifetime, confirmed exit, protected registration re-read, ownership-checked metadata removal and typed retained outcomes. Raw client info/lock removal helpers are gone. Replaced, unreadable or unproven metadata is retained.

    The final head passed ownership/retirement controls, its affected gate and all 21 GitHub checks. Closing the metadata/lock ownership defect. The separate question of whether one timed-out request should terminate sibling sessions or host-wide runners remains open in #3177.

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