Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aether-users] Multiple processes writing to same local repository (in very specific circumstances)

Hi Ron,

> The answer is yes -- the processes will interfere with one another and
> corrupt the artifacts (or, at least, some of the processes will fail).
> The solution is to use this Aether plugin
> <https://github.com/takari/takari-local-repository> that allows
> concurrent access to a shared local repository (it uses lock files).

thanks for your reply. As I said, I am aware of the
takari-local-repository plugin. However, from my observations so far,
Aether seems to behave just fine under the circumstances I outlined:

- Process 1 is asked to resolve a SNAPSHOT artifact
- Process 1 creates a maven-metadata-models.xml.part.lock
- Process 1 creates a maven-metadata-models.xml.part and begins the
  download
- Process 2 is asked to resolve the same SNAPSHOT artifact
- Process 2 blocks as long as maven-metadata-models.xml.part.lock is
  present
- Process 1 finishes the download and deletes the maven-metadata-
  models.xml.part.lock
- Process 2 unblocks and "finishes" the download, using the file
  downloaded by process 1

The same would happen for the actual artifact, not just the metadata.

Now, I realize that takari-local-repository does more than just file
locking, e.g., keeping track of which remote repo an artifact came from,
but this is not relevant for our specific use case: Process 1 and 2 will
use the same local repo *iff* they use the same remote repo.

But maybe I am missing something. If so, please tell me what. From a
cursory look at the code and some experimentation plain Aether looks
sufficient in our circumstances (but I have tested OS X only, so far).

Best wishes,

Andreas

-- 
Codetrails GmbH
The knowledge transfer company

Robert-Bosch-Str. 7, 64293 Darmstadt
Phone: +49-6151-276-7092
Mobile: +49-170-811-3791
http://www.codetrails.com/

Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940


Back to the top