-
-
Notifications
You must be signed in to change notification settings - Fork 424
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
Resolver Infinite loop on simple version collision #3027
Comments
On my machine the resolution succeeds in 30s, with |
1min for me (pdm lock -v 60.83s user 0.55s system 75% cpu 1:21.24 total), on Linux. Pydantic 1.10.17 too. Seems like pip stops backtracking earlier. |
@carlkibler you make good points though!
Yep, could be printed in on each round like
In addition to "round 61/10000", PDM could indeed issue a message in non-verbose mode every couple hundreds rounds.
Note that it was initially set to 500, and this was generally way too low, so @frostming increased it by a lot. You'll probably find more info by grepping the git logs or PRs on GitHub. |
You all are right, which is frustrating! Thanks for trying. Some fun updates for completeness: Today:
So I can't replicate yesterday's behavior, which was up in the thousands of resolver attempts. Baffling stuff. I withdraw my specific bug report, until I actually replicate it. -- I am happy to re-craft this into a feature request toward that end, or close this and make a separate feature request. My only goal is to help you all not get pestered by issues like this one. |
No, I even used
This sounds good to me. |
Seems lots of work needed to
since the iteration is located in resolvelib. |
I read other "infinite loop" bugs (#2633, #2545, #1119, #908) but wanted to point out the general bug of running the resolver through 10k tries when there's a fairly obvious unresolvable conflict.
Make sure you run commands with
-v
flag before pasting the output.Steps to reproduce
langchain
andgretel-python-client
. (file below)pyproject.toml:
Actual behavior
PDM will go into resolution spin up to value of
strategy.resolve_max_rounds
(default is 10k). Ok. Here's the conflict:pydantic==1.10.17
pydantic<3.0.0,>=2.7.4
pip reports the conflict immediately:
This is great because it's clear and tells me quickly. Having
pdm lock
work for 10+ minutes and not notice this is a bug to me.Expected behavior
What is a "normal" amount of loops for a project? 10, 50? 100? I would suggest after 1 minute or 100 resolution attempts, print a message telling the user the resolver will continue trying up to 10k times and how to configure that limit.
I wonder if the default limit should be much lower (50? 100?) and tell users instead "in large projects the value may need to be set higher, and here's how...".
If a reasonable resolver attempts is <50, then make that the default to save time for the vast majority of uses, and tell huge-project users to set that value because they are a special case. It would be more user friendly.
Environment Information
The text was updated successfully, but these errors were encountered: