Welcome! Please see the About page for a little more info on how this works.

+5 votes
in tools.deps by
retagged by

depes.edn:

{:deps {org.deeplearning4j/deeplearning4j-nlp {:mvn/version "1.0.0-M2.1"}}}

It happened before in an older Clojure version, but disappeared, see here:

https://clojurians-log.clojureverse.org/tools-deps/2021-09-16

Now I have it back with a recent clojure CLI:
1.11.1.1200

The workarround is still to limit the number of download threads;

clj -Sthreads 1

So it only happens to me using (the default) multi-threaded downloading.

by
Howdy,

I just want to thank you for the very usable informations shared here, sadly I learned about this only after Maven issue tracker got a link to this forum entry (a week ago or so).

I would like to encourage everyone using (directly or indirectly) maven-resolver to feel free to report issues there: https://github.com/apache/maven-resolver

This thread did introduce me cool stuff like wondershaper (that after all proved unneeded, as other comment pointed me to "big enough" artifacts to create reproducer for this very issue). Thanks

Edit: fix to be expected in Resolver 1.9.25 (and 2.0.14)

2 Answers

+2 votes
by

I haven't been able to reproduce this and haven't had any other reports from anyone on this for a while, so not going to create a ticket for now.

by
I cannot reproduce neither from work, on a fast network.
I will try again from home later, on a slow line.
by
I can reproduce it  by limiting the bandwidth of my work machine.

So first running:

sudo wondershaper -a eth0 -d 1024 -u 1024

to limit download bandwith to 1MBit/s

and then starting the clj from latest Clojure Docker image

docker run -ti clojure clj -Sdeps '{:deps {org.deeplearning4j/deeplearning4j-nlp {:mvn/version "1.0.0-M2.1"}}}'


fails with:


Downloading: com/twelvemonkeys/imageio/imageio-bmp/3.1.1/imageio-bmp-3.1.1.jar from central
Downloading: org/bytedeco/javacpp/1.5.7/javacpp-1.5.7-linux-arm64.jar from central
Error building classpath. Could not acquire write lock for 'artifact:org.bytedeco:leptonica:1.82.0-1.5.7'
java.lang.IllegalStateException: Could not acquire write lock for 'artifact:org.bytedeco:leptonica:1.82.0-1.5.7'
        at org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapter$AdaptedLockSyncContext.acquire(N
by
Thanks, I think I understand why we're seeing this again and have some things to look at
0 votes
by
by
I work on a daily base with "docker" and "devcontainers", which result in very often having an "empty" .m2 folder, so loading dependencies often.
(and I use data science libraries which often have "big" native jars)

I see the problem every day on different clojure versions

In all my "scripts", I use by default now "clj -Sthreads 1" and when I forget it, I see it again immediately.
by
GitHub agents are a good spot to see the problem, as they start with an "empty" .m2 folder.
If here:
https://github.com/scicloj/metamorph.ml/blob/14b4e609a18ec9b291bc26a160108d249e56ba70/.github/workflows/main.yml#L50

I would remove here the "-Sthreads 1", the build would (I believe) fail  on each run.
by
The -Sthreads 1 there is being ignored based on where it is in the command line, so it has no effect, and would have no effect if removed.
ago by
I really think the problem went away with clojure 1.12.5....

I have at home very re-producible scenarios, 100 % failure without "-Sthreads 1", but since a few days, I somehow noticed that I don't need it any more.

Was there any change in latest Clojure, which could have fixed it ?
ago by
The most recent version of the CLI incorporates newer Maven resolver libs where they redid some of the file locking protocols, so that could definitely have an effect.
...