-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Up until now the locking mechanism used to prevent concurrent downloads was just the existence of a lock file. This implementation had several problems: - Locking procedure was unsafe - it was possible for more than one process to enter critical section at the same time. This was "fixed" by putting random sleep in front of it, but that is not a proper synchronisation mechanism. - Download procedure was clearing whole directory at one point. This caused lockfile to be removed too, so it was possible for another process to enter the critical section at this point. - If the process was killed unexpectedly, the lockfile remained in place. If you try to start downloading again it will wait for an hour for the lockfile to be deleted. This is frustrating when running e.g. tests for some driver, as they just hang and you have no idea why. This commit replaces that with advisory locks and fixes all those problems. Now the download procedure will just restart if it was aborted previously. It's no longer possible for 2 processes to enter critical section, so the (0-5) seconds sleep is removed. Download procedure no longer removes the lockfile. (cherry picked from commit e721a5b)
- Loading branch information
Showing
3 changed files
with
221 additions
and
52 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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