Skip to content

fix(serve): clear the daemon control file only after the daemon has exited #142

Description

@Ariestar

From CodeRabbit review on #141 (comment 3790957344, serve.rs:56).

ipc::running() treats LocalResponse::Error, connect failure, timeout, and invalid responses all as "not running". serve start then unconditionally calls remove_daemon_info(), even when an active daemon still holds daemon.lock — the replacement waits 15s and fails.

Action: only clear daemon.json after confirming the connection was refused, the control file is absent, or the daemon has exited. Keep the control file when an active daemon returns an error. Add an integration test covering the active-daemon-error case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions