Repository navigation
windows.process_alive: compare full hostid and check thread != 0 - #10651
Open
underiya-ai wants to merge 1 commit into
Open
underiya-ai wants to merge 1 commit into
underiya-ai wants to merge 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.47% 89.39% -0.08%
==========================================
Files 105 105
Lines 20343 20343
Branches 3199 3199
==========================================
- Hits 18201 18185 -16
- Misses 1489 1502 +13
- Partials 653 656 +3 ☔ View full report in Codecov by Harness. |
This branch has not been deployed
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.