Repository navigation
windows.process_alive: compare full hostid and check thread != 0 - #10651
Merged
ThomasWaldmann merged 1 commit intoDec 2, 2026
Merged
ThomasWaldmann merged 1 commit into
ThomasWaldmann merged 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10651 +/- ##
==========================================
- Coverage 89.48% 89.47% -0.01%
==========================================
Files 105 105
Lines 20343 20343
Branches 3199 3199
==========================================
- Hits 18203 18202 -1
Misses 1486 1486
- Partials 654 655 +1 ☔ View full report in Codecov by Harness. |
underiya-ai
force-pushed
the
fix-windows-process-alive-hostid
branch
from
December 1, 2026 18:00
9dcdd67 to
25f8fd3
Compare
ThomasWaldmann
approved these changes
Dec 2, 2026
ThomasWaldmann
left a comment
Member
There was a problem hiding this comment.
Thanks, LGTM. Windows process_alive now does the same hostid/thread checks as the POSIX one, and the rebase correctly switched the #10650 test to get_hostid().
Optional follow-up for later: windows.local_pid_alive still raises NotImplementedError - moving the OpenProcess/GetExitCodeProcess part there would make process_alive identical to the POSIX version.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR fix?
Previously,
platform.windows.process_alive()only comparedhost.split('@')[0].lower()againstplatform.node().lower()and ignoredthread. However, locks store the fullget_hostid()(f"{get_fqdn()}@{uuid.getnode()}"orBORG_HOST_ID):get_fqdn()includes the domain suffix whileplatform.node()does not, causing local locks to be treated as remote.platform.node()) but having differentuuid.getnode()values were treated as the same host, risking false stale-lock detection.Solution
platform.windows.process_alive()withplatform.posix.process_alive()by comparing the fullhost != get_hostid()and checkingthread != 0before querying the local PID.platformimport fromsrc/borg/platform/windows.pyx.src/borg/testsuite/platform/windows_test.pyto useget_hostid()and add tests for mismatchedhostidand non-zerothread.