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

Improve robustness of PipInstall plugin #7102

Closed
hendrikmakait opened this issue Oct 4, 2022 · 1 comment · Fixed by #7111
Closed

Improve robustness of PipInstall plugin #7102

hendrikmakait opened this issue Oct 4, 2022 · 1 comment · Fixed by #7111
Assignees
Labels
enhancement Improve existing functionality or make things work better

Comments

@hendrikmakait
Copy link
Member

hendrikmakait commented Oct 4, 2022

The PipInstall plugin currently relies on rather brittle and untested logic to determine restarts which may result in infinite restart loops (see #7037). In addition to this, it is not safe in scenarios where we have multiple workers sharing a file systems and attempting to install packages simultaneously. In this scenarios, some workers might not restart if another worker already installed packages, but they have not updated their Python environment accordingly (

Additional issues may arise if multiple workers share the same
file system. Each worker might try to install the packages
simultaneously.
).

To avoid this, we should track on which hosts packages have been installed and which workers have already restarted. This can be done by using Client.{get|set}_metadata. By using a distributed.Lock, the PipInstall plugin already instantiates a client that we can reuse. This way, we can ensure that all workers restart on a machine on which packages have been installed and we can ensure that they only restart once. This will remove the brittle string matching logic.

To further improve the PipInstall plugin, we should replace the use of the distributed.Lock with a distributed.Semaphore to avoid deadlocks when workers fail unexpectedly.

@hendrikmakait hendrikmakait added the enhancement Improve existing functionality or make things work better label Oct 4, 2022
@hendrikmakait hendrikmakait self-assigned this Oct 4, 2022
@jrbourbeau
Copy link
Member

+1 from me. Totally agree PipInstall could use some TLC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve existing functionality or make things work better
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants