[MRESOLVER-372] Rework the FileUtils collocated temp file by cstamas · Pull Request #364 · apache/maven-resolver (original) (raw)
Fixes:
- move() call should NOT perform the move, as writer stream to tmp file may still be open
- move the file move logic to close, make it happen only when closing collocated temp file
- perform fsync before atomic move to ensure there is no OS dirty buffers related to newly written file
- on non-Win OS fsync the parent directory as well.
https://issues.apache.org/jira/browse/MRESOLVER-372
cstamas changed the title
[MRESOLVER-372] Fallback to non-atomic move on AccessDeniedEx [MRESOLVER-372] Rework the FileUtils collocated temp file
cstamas added a commit that referenced this pull request
Fixes:
- move() call should NOT perform the move, as writer stream to tmp file may still be open
- move the file move logic to close, make it happen only when closing collocated temp file
- perform fsync before atomic move to ensure there is no OS dirty buffers related to newly written file
- on windows go with old code that for some reason works (avoid NIO2)
- on non-Win OS fsync the parent directory as well.
https://issues.apache.org/jira/browse/MRESOLVER-372
Backport to 1.9.x branch of the #364
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})