Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

docs(process_lock): clarify Windows error handling for _is_pid_alive (#849)

Sense_wang5346fe47d227
diff --git a/openviking/utils/process_lock.py b/openviking/utils/process_lock.py
index 5b233ce3c..5cc3934da 100644
--- a/openviking/utils/process_lock.py
+++ b/openviking/utils/process_lock.py
@@ -43,10 +43,13 @@ def _is_pid_alive(pid: int) -> bool:
# Process exists but we can't signal it.
return True
except OSError:
- # On Windows, os.kill(pid, 0) raises OSError (WinError 87 "The
- # parameter is incorrect") for stale or invalid PIDs instead of
- # ProcessLookupError. Treat this as "not alive" so stale lock
- # files are correctly reclaimed.
+ # On Windows, os.kill(pid, 0) raises OSError for stale or invalid
+ # PIDs instead of ProcessLookupError. Common errors include:
+ # - WinError 87 "The parameter is incorrect"
+ # - WinError 11 "An attempt was made to load a program with an
+ # incorrect format"
+ # Treat any OSError as "not alive" so stale lock files are
+ # correctly reclaimed on Windows.
return False