Repository navigation
fix: drop repodata gateway before indexing local channel on publish - #6364
Conversation
`pixi publish` to a local/network filesystem channel could fail to index with a Windows `os error 1224` (ERROR_USER_MAPPED_FILE) when the target channel was also a channel the workspace solved against during the build. The repodata `Gateway` memory-maps the `repodata.json` files it reads. The open mapping prevents the subsequent indexing step from overwriting that file on Windows. Dropping the command dispatcher (and with it the gateway) after the build phase releases the mappings before indexing runs. Fixes #6362
| // Phase 1 is done with the command dispatcher. Drop it (and with it the | ||
| // repodata `Gateway`) before we start writing into the target channel. | ||
| // | ||
| // The gateway memory-maps the `repodata.json` files it reads while solving. | ||
| // When the publish target is a local channel that the workspace also solves | ||
| // against, the gateway holds an open mmap of that channel's `repodata.json`. | ||
| // On Windows, indexing then fails to overwrite it with `os error 1224` | ||
| // (ERROR_USER_MAPPED_FILE: "The requested operation cannot be performed on a | ||
| // file with a user-mapped section open."). Dropping the dispatcher releases | ||
| // those mappings so the subsequent `index_fs`/`index_s3` can rewrite the | ||
| // repodata. See https://github.com/prefix-dev/pixi/issues/6362. | ||
| // | ||
| // The gateway lives in two places inside the dispatcher (`data.gateway` and a | ||
| // clone in the compute engine's data store), both owned solely by this value, | ||
| // so this drop fully tears it down. |
There was a problem hiding this comment.
This comment seems a bit excessive
|
I think a much better fix would be: conda/rattler#2084 |
|
Actually since that is already in this should not be a problem? Can you ask clanker why this still happens? |
|
|
I have a sister PR that addresses this issue using the OpenDAL atomic write functions: conda/rattler#2511 |
|
IMO we could still merge this. The other PR should also help. |
|
Sure but as soon as we need the command dispatcher for something else and remove the drop it will still break. A proper solution, like the one you just merged in rattler will make this completely unnecessary. |
|
I'll close this for now. |
|
I think it would still be useful to merge this for now. I think it makes sense to drop the gateway before reindexing ... |
pixi publishto a local/network filesystem channel could fail to indexwith a Windows
os error 1224(ERROR_USER_MAPPED_FILE) when the targetchannel was also a channel the workspace solved against during the build.
The repodata
Gatewaymemory-maps therepodata.jsonfiles it reads. Theopen mapping prevents the subsequent indexing step from overwriting that
file on Windows. Dropping the command dispatcher (and with it the gateway)
after the build phase releases the mappings before indexing runs.
Fixes #6362