You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Václav Haisman <vh...@gmail.com> on 2024/02/29 11:15:54 UTC

Maven resilience to interrupted install to local repository

Hi.

How resilient is Maven to JVM being killed (K8s POD being killed) while it
is installing artifact files into a local repository? Does it do the copy
into a temporary file then rename method or does it copy into the target
artifact file directly?

-- 
VH

Re: Maven resilience to interrupted install to local repository

Posted by Stanimir Stamenkov <s7...@netscape.net.INVALID>.
Thu, 29 Feb 2024, /Tamás Cservenák/:

> am not Windows user, but we had several reports about issues, like this one:
> https://issues.apache.org/jira/browse/MRESOLVER-372

I see.  Thank you for the reference.

As far as I'm aware, such "access denied" exceptions on Windows are not 
specific to atomic moves.  It could happen one process has opened a file 
for reading, preventing another from overwriting it immediately.  I 
guess such updates need a retry mechanism, at least for the atomic move 
part.


> On Thu, Feb 29, 2024 at 1:40 PM Stanimir Stamenkov wrote:
>> Thu, 29 Feb 2024, /Tamás Cservenák/:
>>
>>> Resolver 1.9.18 uses the temp file technique you describe:
>>> copies to (random) temp file located in the same directory where target 
>>> file is, and then atomically moves the file to its place
>>> (unless OS is windows, for obvious reasons).
>>
>> Doesn't atomic file move/replace work on Windows?  I'm using 
>> Files.move() [1] with ATOMIC_MOVE [2] option to achieve the same 
>> technique on Windows successfully.
>>
>> [1] https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/nio/file/Files.html#move(java.nio.file.Path,java.nio.file.Path,java.nio.file.CopyOption..
>> .)
>> [2] https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/nio/file/StandardCopyOption.html#ATOMIC_MOVE

-- 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven resilience to interrupted install to local repository

Posted by Tamás Cservenák <ta...@cservenak.net>.
Howdy,

am not Windows user, but we had several reports about issues, like this one:
https://issues.apache.org/jira/browse/MRESOLVER-372

T

On Thu, Feb 29, 2024 at 1:40 PM Stanimir Stamenkov
<s7...@netscape.net.invalid> wrote:

> Thu, 29 Feb 2024, /Tamás Cservenák/:
>
> > Resolver 1.9.18 uses the temp file technique you describe:
> > copies to (random) temp file located in the same directory where target
> > file is, and then atomically moves the file to its place
> > (unless OS is windows, for obvious reasons).
>
> Doesn't atomic file move/replace work on Windows?  I'm using
> Files.move() [1] with ATOMIC_MOVE [2] option to achieve the same
> technique on Windows successfully.
>
> [1]
>
> https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/nio/file/Files.html#move(java.nio.file.Path,java.nio.file.Path,java.nio.file.CopyOption..
> .)
> [2]
>
> https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/nio/file/StandardCopyOption.html#ATOMIC_MOVE
>
> --
> Stanimir
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Maven resilience to interrupted install to local repository

Posted by Stanimir Stamenkov <s7...@netscape.net.INVALID>.
Thu, 29 Feb 2024, /Tamás Cservenák/:

> Resolver 1.9.18 uses the temp file technique you describe:
> copies to (random) temp file located in the same directory where target 
> file is, and then atomically moves the file to its place
> (unless OS is windows, for obvious reasons).

Doesn't atomic file move/replace work on Windows?  I'm using 
Files.move() [1] with ATOMIC_MOVE [2] option to achieve the same 
technique on Windows successfully.

[1] 
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/nio/file/Files.html#move(java.nio.file.Path,java.nio.file.Path,java.nio.file.CopyOption...)
[2] 
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/nio/file/StandardCopyOption.html#ATOMIC_MOVE

-- 
Stanimir

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven resilience to interrupted install to local repository

Posted by Tamás Cservenák <ta...@cservenak.net>.
Resolver 1.9.18 uses the temp file technique you describe:
copies to (random) temp file located in the same directory where target
file is, and then atomically moves the file to its place
(unless OS is windows, for obvious reasons).

T

On Thu, Feb 29, 2024 at 12:17 PM Václav Haisman <vh...@gmail.com> wrote:

> Hi.
>
> How resilient is Maven to JVM being killed (K8s POD being killed) while it
> is installing artifact files into a local repository? Does it do the copy
> into a temporary file then rename method or does it copy into the target
> artifact file directly?
>
> --
> VH
>