Re: Maven resilience to interrupted install to local repository

2024-02-29 Thread Stanimir Stamenkov

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-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Maven resilience to interrupted install to local repository

2024-02-29 Thread Tamás Cservenák
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
 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-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: Maven resilience to interrupted install to local repository

2024-02-29 Thread Stanimir Stamenkov

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-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Maven resilience to interrupted install to local repository

2024-02-29 Thread 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).

T

On Thu, Feb 29, 2024 at 12:17 PM Václav Haisman  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
>


Maven resilience to interrupted install to local repository

2024-02-29 Thread Václav Haisman
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