Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions openviking/utils/process_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
Loading