Uploaded image for project: 'Mender'
  1. Mender
  2. MEN-5570

mender-gateway: research and implement the best file lock mechanism to avoid race-conditions

    XMLWordPrintable

    Details

      Description

      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

       

        Attachments

          Activity

            People

            Assignee:
            alfrunes Alf-Rune Siqveland
            Reporter:
            tranchitella Fabio Tranchitella
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support