Parallel request handling
The implementation will need a way to handle parallel downloads of the same Artifact. This will be solved through a global lock on modifications to the Artifact Cache.
Hence the storage layer needs a global lock file, for preventing parallel modifications to the Cache.
In this case, if a second device asks for the same Artifact, whilst it is already downloading to the cache, the client shall receive a 204, NO CONTENT from the gateway, until the download to the Cache has finished. The lock file needs an auto-expiration mechanism to avoid locking the file forever (e.g. 1h).
This task is about:
- Figuring out the best way for a global lock on the file system (Needs to be applicable to local storage, as well as network storage file systems here)
- Implementing the given global lock mechanism
- Implement the 204 response, in case a download is under way already