Skip to content

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

fix(utils): handle additional Windows OSError codes in process_lock (#854)

Andrew Barnes95636abdcf16
diff --git a/openviking/utils/process_lock.py b/openviking/utils/process_lock.py
index 5cc3934da..f60452ae6 100644
--- a/openviking/utils/process_lock.py
+++ b/openviking/utils/process_lock.py
@@ -9,6 +9,7 @@ directory, which causes silent failures in AGFS and VectorDB.
import atexit
import os
import signal
+import sys
from openviking_cli.utils import get_logger
@@ -43,14 +44,16 @@ 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 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
+ if sys.platform == "win32":
+ # 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
+ raise
def acquire_data_dir_lock(data_dir: str) -> str: