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

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