Skip to content

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

Open
haosenwang1018 wants to merge 1 commit intovolcengine:mainfrom
haosenwang1018:fix/windows-process-lock-docs
Open

docs(process_lock): clarify Windows error handling for _is_pid_alive#849
haosenwang1018 wants to merge 1 commit intovolcengine:mainfrom
haosenwang1018:fix/windows-process-lock-docs

Conversation

@haosenwang1018
Copy link
Contributor

Summary

Update the comment in _is_pid_alive() to document additional Windows error codes that can be raised by os.kill(pid, 0) for stale or invalid PIDs. The previous comment only mentioned WinError 87, but users have reported WinError 11 (ERROR_BAD_FORMAT) as well in issue #842.

Changes

  • Expand the comment to document multiple Windows error codes:
    • WinError 87 "The parameter is incorrect"
    • WinError 11 "An attempt was made to load a program with an incorrect format"
  • Clarify that any OSError should be treated as "not alive"

Why

This documentation improvement helps future maintainers understand why the broad OSError catch is necessary and prevents confusion when different Windows error codes are encountered.

Related Issue

Related to #842

Update the comment in _is_pid_alive() to document additional Windows
error codes that can be raised by os.kill(pid, 0) for stale or invalid
PIDs. The previous comment only mentioned WinError 87, but users have
reported WinError 11 (ERROR_BAD_FORMAT) as well.

This change ensures the documentation accurately reflects the various
Windows errors that can occur, helping future maintainers understand
why the broad OSError catch is necessary.

Related to volcengine#842
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions
Copy link

Failed to generate code suggestions for PR

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants