Skip to content

CQ: Retry opening file when flushing buffers to avoid "DELETE PENDING" issues on Windows #14108

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

Merged
merged 1 commit into from
Jun 25, 2025

Conversation

lhoguin
Copy link
Contributor

@lhoguin lhoguin commented Jun 23, 2025

This is meant to prevent issues on Windows when recently deleted files are not immediately available for reopening and writing (they are in "DELETE PENDING").

This is a fix for #14094

Pending further testing.

@lhoguin lhoguin force-pushed the loic-cq-dont-delete-current-write-file branch 2 times, most recently from b14bbaf to 415e46e Compare June 24, 2025 10:16
@lhoguin lhoguin force-pushed the loic-cq-dont-delete-current-write-file branch from 415e46e to 22e51c0 Compare June 24, 2025 11:30
On Windows the file may be in "DELETE PENDING" state following
its deletion (when the last message was acked). A subsequent
message leads us to writing to that file again but we can't
and get an {error,eacces}. In that case we wait 10ms and retry
up to 3 times.
@lhoguin lhoguin force-pushed the loic-cq-dont-delete-current-write-file branch from 22e51c0 to ff8ecf1 Compare June 24, 2025 11:30
@lhoguin lhoguin changed the title Skip periodic flush if disk written to recently CQ: Retry opening file when flushing buffers to avoid "DELETE PENDING" issues on Windows Jun 24, 2025
@lhoguin lhoguin marked this pull request as ready for review June 24, 2025 13:32
@lhoguin
Copy link
Contributor Author

lhoguin commented Jun 24, 2025

This is ready for review.

We need to provide the user with a Windows installer to confirm that it fixes their issue. @michaelklishin How?

@mkuratczyk
Copy link
Contributor

you can build a Windows package on a non-windows machine like this:

make source-dist
make package-windows SOURCE_DIST_FILE=...output_file_from_make_source-dist...

@michaelklishin
Copy link
Collaborator

@lhoguin for every merged PR, we have alpha builds that include a Windows installer.

We don't have them for PRs so building the installer locally (on Linux) is the only option.

@lhoguin
Copy link
Contributor Author

lhoguin commented Jun 25, 2025

I'm failing to make it work locally. I will merge the PR and provide a link to the alpha. Thanks!

@lhoguin lhoguin merged commit 71f5bab into main Jun 25, 2025
845 of 848 checks passed
@lhoguin lhoguin deleted the loic-cq-dont-delete-current-write-file branch June 25, 2025 07:47
@michaelklishin michaelklishin added this to the 4.2.0 milestone Jun 25, 2025
@lhoguin
Copy link
Contributor Author

lhoguin commented Jun 25, 2025

@Mergifyio backport v4.1.x

Copy link

mergify bot commented Jun 25, 2025

backport v4.1.x

✅ Backports have been created

michaelklishin added a commit that referenced this pull request Jun 25, 2025
CQ: Retry opening file when flushing buffers to avoid "DELETE PENDING" issues on Windows (backport #14108)
@michaelklishin
Copy link
Collaborator

There's a follow-up PR: #14178.

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