Skip to content
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

parallel download race condition errors out with: dest already exists #1552

Open
3 tasks done
kneirinck opened this issue Aug 22, 2023 · 2 comments
Open
3 tasks done
Labels

Comments

@kneirinck
Copy link

kneirinck commented Aug 22, 2023

Preflight Checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Issue Details

  • Electron Packager Version:
    • 17.2.0
  • Electron Version:
    • v22.2.0
  • Operating System:
    • Arch Linux
  • Last Known Working Electron Packager version::
    • N/A

Expected Behavior

Parallel downloads of electron always succeed without issues.

Actual Behavior

Parallel downloads of electron sometimes fail with the error dest already exists.
It basically boils down to what's described in #1421 and #1540
The moving of SHASUMS256.txt for each download runs into a race condition.

To Reproduce

As it's a race condition that's happening when downloading data it's not that easy to reproduce.
One way I found is adjusting @electron/get to not actually download the zipfile and only the checksum which makes it easier to download & move the checksum file at the same time.
Checksum fails afterwards for obvious reasons but at least it's quicker & easier to reproduce that way.

Additional Information

For now I've been able to fix this by not passing multiple platforms/archs at once and just running the packager multiple times.
The simple fix is to run downloads in sequence instead of in parallel but that slows down the downloading.
One other option would be with a similar fix as for the tests (see PR mentioned above) and downloading the checksum file explicitly before the other downloads run in parallel.
Another option would be @electron/get fixing it internally to prevent such an issue when it's running in parallel.

@welcome
Copy link

welcome bot commented Aug 22, 2023

👋 Thanks for opening your first issue here! If you have a question about using Electron Packager, read the support docs. If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. Development and issue triage is community-driven, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@erickzhao
Copy link
Member

Thanks for the report @kneirinck! We've actually run into this somewhat frequently in CI on this very repo, which is annoying 😓 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants