-
Notifications
You must be signed in to change notification settings - Fork 235
[RQD][FIX] Windows log rotation retries #2121
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
[RQD][FIX] Windows log rotation retries #2121
Conversation
|
Hi @anton-ubi, Thanks for your contribution, I am finishing one extra review. I will merge or comment on your code soon |
ramonfigueiredo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @anton-ubi, great job.
Some minor changes before merge your PR to the master.
Thanks for your contribution again.
|
Changes addressed. Thanks for your feedback! |
624775b
into
AcademySoftwareFoundation:master
|
Great job, @anton-ubi . Thank you! |
Summary
Attempts retry when the RQD log rotation fails on Windows with error
[WinError 32] The process cannot access the file because it is being used by another process.Rationale
On Windows, log rotation may fail if the log file is temporarily locked by another process. Although this scenario was previously handled by silently ignoring the failure, it could still lead to logs not being rotated as expected.
Changes
If log rotation fails, it is now retried up to three times, with a minimal delay between each attempt. This approach helped us on our end limiting warning messages.
The implementation uses a strategy pattern, to prevent hard-to-maintain OS-dependent if/else logic cases for future platform-specific specializations.