Skip to content

fix: pidIsAlive self-PID check for stale lock detection#2099

Open
34262315716 wants to merge 2 commits into
MemTensor:mainfrom
34262315716:fix/stale-pid-lock
Open

fix: pidIsAlive self-PID check for stale lock detection#2099
34262315716 wants to merge 2 commits into
MemTensor:mainfrom
34262315716:fix/stale-pid-lock

Conversation

@34262315716

Copy link
Copy Markdown
Contributor

Fixes #2098

Problem

When OpenClaw gateway exits abnormally, the openclaw-runtime.lock/ dir and owner.json remain on disk. On restart, if the OS reuses the same PID, pidIsAlive() signals itself and incorrectly reports duplicate runtime.

Fix

Added if (pid === process.pid) return false; in pidIsAlive() to exclude self-PID from stale lock check. Zero side-effect: owner.pid can only equal process.pid when the lock is from a previous lifecycle of the same process.

Files changed

  • apps/memos-local-plugin/adapters/openclaw/runtime-lock.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:plugin OpenClaw & Hermes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pidIsAlive misidentifies own PID as duplicate runtime when lock file is stale

2 participants