-
Notifications
You must be signed in to change notification settings - Fork 104
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
Avoid I/O deadlock with conda #581
Conversation
✅ Deploy Preview for conda-lock ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
`conda lock` may deadlock with a child `conda` process, it may be trying to read from `stdout` while `conda` is trying to write to `stderr` (blocked) Reading from `stdout` in a separate thread allows `stderr` to be consumed in the main thread.
Thanks so much @tadeu for tracking down this tricky deadlock and submitting a fix for it!!! These things take a lot of time and effort to diagnose, so I'm very grateful. I'm thinking about an alternative fix in #582 where instead of introducing threads we get rid of |
It seems that #582 would also fix the deadlock, but would |
And thank you for working on this awesome tool and maintaining it! 😃 |
Indeed IIUC that approach would only provide any output at the end of the call, which can take minutes in some cases, so while simpler I think we will lose UX. The solution in this PR solves the problem (which is really annoying in CI, happens a few times during the day), is simple, and localized to a small part of the code. |
Co-authored-by: Bruno Oliveira <bruno@soliv.dev>
Thanks @tadeu, and thanks also @nicoddemus for the much appreciated review! |
Thanks @maresb for merging the fix! Are there any plans for a new release soon? |
Ya, I'm trying to get something out now.
Has this been happening for a while, or is this due to a regression? |
Awesome, many thanks! 🙇
Can't say, we just started using conda-lock at |
Add explanation and minor improvement to #581
Description
conda lock
may deadlock with a childconda
process, it may be trying to read fromstdout
here:conda-lock/conda_lock/invoke_conda.py
Line 143 in aa49149
while
conda
is trying to write tostderr
(blocked) here:https://github.com/conda/conda/blob/604f2b7ddf7d8c5a3ef00698fb4bd1ce78eadbd1/conda/exceptions.py#L1258
Reading from
stdout
in a separate thread allowsstderr
to be consumed in the main thread.(It's difficult to write a MRE, but this is happening when
conda lock install
is callingconda create
, right afterconda
finishes verifying the transaction and is going to report a bunch ofClobberWarning
s.)