Skip to content

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

Merged
cstamas merged 4 commits into
apache:maven-resolver-1.9.xfrom
cstamas:maven-resolver-1.9.x-MRESOLVER-372
Nov 17, 2023
Merged

cstamas merged 4 commits into
apache:maven-resolver-1.9.xfrom
cstamas:maven-resolver-1.9.x-MRESOLVER-372

Conversation

@cstamas

@cstamas cstamas commented Nov 15, 2023 •

Copy link
Copy Markdown
Member

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
@cstamas
cstamas deleted the maven-resolver-1.9.x-MRESOLVER-372 branch November 17, 2023 12:27
@jira-importer

Copy link
Copy Markdown

Resolve #1049

1 similar comment
@jira-importer

Copy link
Copy Markdown

Resolve #1049

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants