Skip to content

Conversation

@mkuratczyk
Copy link
Contributor

On Windows, when creating a snapshot (renaming a checkpoint), occasionally prim_file:rename failed with eacces. It's not clear why this happens, it appears that Windows may not release the file handle immediately after closing the file so a close->rename in a quick succession may sometimes return an error.
With this commit, we just retry after 20ms and so far, in our testing, the error has never occurred on the second attempt (with a 10ms delay, it still failed every now and then)

We could have separate macros for eagain and eaccess, but I went with a shared one. One retry seems reasonable in both cases.

On Windows, when creating a snapshot (renaming a checkpoint),
occasionally prim_file:rename failed with `eacces`. It's not clear
why this happens, it appears that Windows may not release the file
handle immediately after closing the file so a close->rename in
a quick succession may sometimes return an error.
With this commit, we just retry after 20ms and so far, in our testing,
the error has never occurred on the second attempt (with a 10ms
delay, it still failed every now and then)

We could have separate macros for eagain and eaccess, but I went with
a share one. One retry seems reasonable in both cases.
@kjnilsson kjnilsson merged commit d034303 into main Jun 10, 2025
4 checks passed
@michaelklishin michaelklishin deleted the retry-rename-on-eacces branch June 10, 2025 11:11
@michaelklishin michaelklishin added this to the 2.16.10 milestone Jun 10, 2025
@michaelklishin michaelklishin modified the milestones: 2.16.10, 2.16.11 Jun 23, 2025
michaelklishin added a commit to rabbitmq/rabbitmq-server that referenced this pull request Jun 24, 2025
mergify bot pushed a commit to rabbitmq/rabbitmq-server that referenced this pull request Jun 24, 2025
to include rabbitmq/ra#546.

(cherry picked from commit 4691a16)
michaelklishin added a commit to rabbitmq/rabbitmq-server that referenced this pull request Jun 25, 2025
LoisSotoLopez pushed a commit to cloudamqp/rabbitmq-server that referenced this pull request Jul 16, 2025
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