-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression in handling concurrency when creating environments #1004
Comments
He @vlad-ivanov-name, |
I tried a few times and got a different error now but I think the root cause is probably related:
Perhaps there's no lock on the .pixi environment dir so initializing it from both commands fails? |
On my Fedora machine I can not reproduce. Is this on windows perhaps? That said maybe @baszalmstra you have any ideas? |
I’m also testing on Fedora 🤔 |
I wonder if it's something related to this? rust-lang/rust#46016 Rye also had this issue: astral-sh/rye#861 |
Just to clarify - the issue only occurs for me when the .pixi folder is deleted. The lockfile is present. The error above is on 0.17.1 |
One other idea would be to set PYTHONUNBUFFERED=1, does that change anything? |
Unfortunately no, still getting errors. I noticed that the errors are sporadic, it's probably a race condition. I used this snippet to try to run the command until the error appears:
|
I think perhaps broken pipe error is just a consequence of the consumer end of the pipe failing to properly initialize and read stdin Screen.Recording.2024-03-26.at.09.40.49.mov |
Actually the minimal reproducible example for me is even simpler, no python involved at all:
|
Just tried the latest version, the bug is still there:
|
So what is happening here is that two pixi' instances are running at the same time and overwriting each others files, is that correct? We should probably add a file lock so that they don't modify the same environment concurrently, correct? |
Yes I think a file lock is necessary. There is https://lib.rs/crates/fs4 crate -- looks like it's cross platform and maintained |
We already have a file lock in pixi / rattler (https://github.com/mamba-org/rattler/blob/40803042b829346ed7522f797d70fd4da20fc12e/crates/rattler_repodata_gateway/src/utils/flock.rs#L204) - so that should be relatively straight-forward :) |
This issue seems to be solve somewhere along the way. Closing for now |
hmm I don't think this is solved. With the same manifest and commands as above, and with
I'm still getting the same error
both pixi processes will try to init the same directory |
should this be reopened or should i open a new issue? |
Checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pixi, using
pixi --version
.Reproducible example
Issue description
In this example, pixi runs a command in an environment, and pipes the output to another command. This seems to break (seemingly after switch to uv but could be unrelated).
The example is run from a clean state.
Doesn't work with 0.16.1
Expected behavior
Works with 0.15.2
The text was updated successfully, but these errors were encountered: