fix: PyPI environment resolve race condition#3232
Conversation
Greptile SummaryThis PR fixes a race condition in PyPI environment resolution during remote execution where the PyPI solve could begin before the local conda base environment was ready. The old code waited on whichever conda create future completed first — including the dummy remote-platform one — while pip resolution always requires the local-platform environment.
Confidence Score: 5/5This is a safe, targeted fix — the change is isolated to a single conditional in the conda/PyPI bootstrap loop and correctly narrows when a PyPI solve is enqueued. The logic is sound: the new guard ensures pip resolution only waits on the create future that actually matters (local platform), and passing No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "apply suggestions" | Re-trigger Greptile |
There exists a race condition in the way
pypienvironments are resolved for remote execution. Thepypiresolving builds upon a base conda environment, which for remote targets we solve two separate ones; a local one for fetching packages with, and a dummy remote one.The race condition is caused by a code path that waits for the base conda environment to be created before starting the pypi environment solving, but this never made a distinction between the local and the dummy remote ones. In rare cases the pypi resolving could then start before the real base conda environment existed yet.