Repository navigation
fix(workspace): keep the write probe inside the Windows path limit - #2398
Merged
Merged
Conversation
9 tasks done
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.
Why
ContentWorkspaceService._ensure_readyproves the outputs folder is writable with a temporary file named:That is 55 characters. On Windows, a custom workspace root under a deep account path can already sit near the 260-character
MAX_PATH; adding the probe pushes it over.Path.touchthen raisesFileNotFoundError(WinError 206), which the service reported as:The folder is writable — the path is just too long. This is product bug 2 in #2354, reproduced there with
DEEPTUTOR_WORKSPACE_ROOTand deep workspace ids.What changes
Shorten the probe to
.dt-wp-<12 hex>(19 characters), which removes 36 characters from the probed path. The reported case was ~272 characters, so it now fits; other deep roots at least fail with the right explanation.When the probe fails with
WinError 206orerrno.ENAMETOOLONG, raise a distinct message:A real permission failure still reports “not writable”, and the symlink/escape checks are unchanged.
The service already used a short probe name in the setup path; this brings the workspace probe in line with it.
Tests
New coverage:
WinError 206failure is reported as a path-length problem, not a permission problem;PermissionErrorstill produces “not writable”.Windows itself is simulated with the
winerrorattribute; the failure mode is the sameOSErrorbranch the service already handled.Refs #2354.