fix: release workspace gateway before indexing on publish - #6579
Merged
Conversation
The repodata gateway memory-maps a local/network channel's repodata.json when that channel is also a source channel. On Windows the open mapping blocks rattler-index from replacing the file: os error 1224 when it truncated in place, and os error 5 now that it renames over the target. Dropping the command dispatcher only released its Arc clone of the gateway; the workspace held another copy in its OnceCell, keeping the mapping alive. Drop the workspace as well so the file is unmapped before indexing runs. Fixes prefix-dev#6362
Contributor
|
But in rattler the file is openened in a way that allows deletion of the file I believe. So this should not be needed. I think there is another root cause. |
Contributor
Author
|
Claude claims the fix is only effective for some filesystems and e.g. not on SMB But I am no windows expert, so that might be wrong. This felt like something maybe worthwhile having as it fixes up Wolf's PR. We should remove that again if rattler has this issue covered. I had to re-open the original issue, so it apparently has not been fixed yet. |
|
@hunger @baszalmstra I tested the fix locally using a local shared folder:
I would be very happy, if this temporary bug fix gets accepted. |
baszalmstra
approved these changes
Jul 15, 2026
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.
The repodata gateway memory-maps a local/network channel's repodata.json when that channel is also a source channel. On Windows the open mapping blocks rattler-index from replacing the file: os error 1224 when it truncated in place, and os error 5 now that it renames over the target.
Dropping the command dispatcher only released its Arc clone of the gateway; the workspace held another copy in its OnceCell, keeping the mapping alive. Drop the workspace as well so the file is unmapped before indexing runs.
Fixes #6362
How Has This Been Tested?
Not at all: It needs windows and a SMB share. I have neither of these.
AI Disclosure
Tools: Claude
Checklist:
schema/model.py.