Skip to content

subsetmerger.py: use filelock to prevent race condition while downloading#1182

Open
RickyDaMa wants to merge 3 commits intogooglefonts:mainfrom
daltonmaag:lock-for-download
Open

subsetmerger.py: use filelock to prevent race condition while downloading#1182
RickyDaMa wants to merge 3 commits intogooglefonts:mainfrom
daltonmaag:lock-for-download

Conversation

@RickyDaMa
Copy link
Copy Markdown
Contributor

Fixes #1181

filelock is already a transitive dependency, so this isn't adding a new dependency.

I moved the download code path under the original conditional as in the isinstance(upstream, str) and upstream not in SUBSET_SOURCES branch, the file's existence has already been checked and the download is never needed, and so we don't need a lockfile. This also fixes "potentially unbound variable" lints for repo & ref.

The first branch already checks if the path exists, so there's no need to do it again
This saves having to define an unneeded lockfile path for the case of local subset sources
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.

Race condition between subset downloads

1 participant