Fix Windows ownership batch timeout causing 3 files to retain wrong owner#70
Merged
Merged
Conversation
…wner The setOwnerWindowsBatch PowerShell command had a hardcoded 60s timeout processing ~21 paths sequentially via Set-Acl (~2-4s each). On slower machines the process was killed before reaching the last several paths, leaving windsurf, gemini, and opencode configs owned by BUILTIN\Administrators. - Scale timeout dynamically (15s per path, 60s minimum) - Add -ErrorAction Stop to Get-Acl/Set-Acl to catch non-terminating errors - Add per-path progress logging for diagnosability Fixes: PROD-23734
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.
Summary
Root cause:
setOwnerWindowsBatchprocesses ~21 paths sequentially via PowerShellSet-Acl(2-4s each on the test machine) with a hardcoded 60s timeout. The three failing hosts are last in the registry processing order — their paths at positions 16, 19, and 20 of 21 simply never get reached before the timeout kills the process.Fix:
Math.max(60_000, paths.length * 15_000)— 15s per path budget with 60s floor-ErrorAction StoptoGet-AclandSet-Aclso non-terminating PowerShell errors are properly caught bytry/catchWrite-Output "[$i/$total] OK: $p") for diagnosability