Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRESOLVER-372] Rework the FileUtils collocated temp file #365

Merged

Conversation

cstamas
Copy link
Member

@cstamas cstamas commented Nov 15, 2023

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

@cstamas cstamas self-assigned this Nov 15, 2023
@cstamas cstamas added this to the 1.9.17 milestone Nov 15, 2023
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 cstamas changed the title [MRESOLVER-372] Fallback to non-atomic move on AccessDeniedEx [MRESOLVER-372] Rework the FileUtils collocated temp file Nov 16, 2023
@cstamas cstamas merged commit 1b8ce7f into apache:maven-resolver-1.9.x Nov 17, 2023
7 checks passed
@cstamas cstamas deleted the maven-resolver-1.9.x-MRESOLVER-372 branch November 17, 2023 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants