fix(models): make model fetching safe under concurrent workers - #364
Merged
wpbonelli merged 1 commit intoSep 20, 2026
Merged
Conversation
Pooch creates a file's parent directory with a bare check-then-makedirs, which raises FileExistsError when concurrent workers (e.g. pytest-xdist) fetch into the same new subdirectory. Create the directory first with exist_ok=True so pooch's existence check passes and it skips makedirs. Also place the zip fetch lock in the cache directory next to the zip it protects, rather than in the cwd, so it excludes processes regardless of their working directory and does not litter it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
wpbonelli
force-pushed
the
fix/concurrent-model-fetch
branch
from
September 20, 2026 12:15
26c704c to
df77f93
Compare
wpbonelli
marked this pull request as ready for review
September 20, 2026 12:15
wpbonelli
added a commit
to modflowpy/pyphoenix-project
that referenced
this pull request
Sep 21, 2026
MODFLOW-ORG/modflow-devtools#364 to fix intermittent CI errors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pooch can produce
FileExistsErrorwhen concurrent workers (e.g. pytest-xdist) try to create the same new subdirectory. Create the directory first withexist_ok=Trueso pooch's existence check passes. See fatiando/pooch#554Also place the lock file in the cache directory next to the zip file it protects, rather than in the cwd, so it excludes processes regardless of their working directory and does not litter it.