Skip to content

Conversation

@mballance
Copy link
Member

When multiple packages are downloaded in parallel via asyncio, they can simultaneously attempt to create the .download directory. The current check-then-create pattern causes [Errno 17] File exists errors.

This changes os.makedirs() to use exist_ok=True, which is thread-safe and handles the race condition properly.

Fixes:

  • Downloads failing with: ERROR: [Errno 17] File exists: '/io/packages/.download'
  • This occurs frequently in CI environments where packages are downloaded in parallel during ivpm update operations.

Testing:
This has been tested with the zuspec-parser project which was consistently hitting this race condition during CI builds with multiple packages being downloaded simultaneously.

When multiple packages are downloaded in parallel via asyncio, they can
simultaneously attempt to create the .download directory. The current
check-then-create pattern causes [Errno 17] File exists errors.

This changes os.makedirs() to use exist_ok=True, which is thread-safe
and handles the race condition properly.

Fixes issues where downloads fail with:
- ERROR: [Errno 17] File exists: '/io/packages/.download'

This occurs frequently in CI environments where packages are downloaded
in parallel during ivpm update operations.
@mballance mballance merged commit 00c8654 into fvutils:master Dec 27, 2025
1 check passed
mballance added a commit to zuspec/zuspec-fe-pss that referenced this pull request Dec 27, 2025
Install ivpm from mballance/ivpm@fix-download-race-condition which
fixes the [Errno 17] File exists race condition when creating the
.download directory during parallel package downloads.

This should eliminate the need for all the manual ANTLR and debug-mgr
workarounds, as ivpm will now properly download and extract packages.

Related: fvutils/ivpm#7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant