Skip to content
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

Gracefully handle interrupt during installation #2738

Open
akhmerov opened this issue Dec 19, 2024 · 4 comments
Open

Gracefully handle interrupt during installation #2738

akhmerov opened this issue Dec 19, 2024 · 4 comments

Comments

@akhmerov
Copy link

Problem description

I have broken the installed environment several times in the following situation.

  • I have a git project using pixi, and I have direnv for automatic activation of the environment.
  • I switch to an old commit to quickly check something out.
  • direnv triggers pixi environment update.
  • I interrupt the update because I don't need it.
  • I then switch back to the latest commit.

On multiple occasions this resulted in a broken environment without pixi being aware about it. To fix it I needed to delete the .pixi folder, and install the environment again. It would be better if the interrupt resulted in a rollback of the installation.

@ruben-arts
Copy link
Contributor

Thanks for the report, is this a new problem or did you see this over an extended period already?

@akhmerov
Copy link
Author

At least a few months. Sorry that I don't provide a reproduction script, it seems hard to do reliably because I assume the breaking depends on when the update is interruped.

@ruben-arts
Copy link
Contributor

Okay thanks, I could think of situations where this would happen as we don't have added behavior on termination of the process. Which could indeed result in a broken prefix. To understand the issue correctly, is the biggest problem that it doesn't fix itself on a rerun or that it leave a broken state?

@akhmerov
Copy link
Author

Not sure what to consider the biggest problem.

If performance or complexity were not an issue, then indeed doing a rollback on interrupt would be best. Repairing would be second best. Detecting that something is wrong third best because already seeing the errors that may arise is confusing (random Python code fails because of version mismatches).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants