Skip to content

Conversation

@anton-ubi
Copy link
Contributor

@anton-ubi anton-ubi commented Dec 19, 2025

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.

@anton-ubi anton-ubi changed the title [RQD][FIX][WinError 32] The process cannot access the file because it is being used by another process. [RQD][FIX] Windows log rotation retries Dec 20, 2025
@ramonfigueiredo
Copy link
Collaborator

ramonfigueiredo commented Jan 5, 2026

Hi @anton-ubi,

Thanks for your contribution, I am finishing one extra review. I will merge or comment on your code soon

Copy link
Collaborator

@ramonfigueiredo ramonfigueiredo left a 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.

@ramonfigueiredo ramonfigueiredo marked this pull request as draft January 5, 2026 21:20
@anton-ubi
Copy link
Contributor Author

Changes addressed. Thanks for your feedback!

@anton-ubi anton-ubi marked this pull request as ready for review January 5, 2026 21:32
@ramonfigueiredo ramonfigueiredo merged commit 624775b into AcademySoftwareFoundation:master Jan 6, 2026
22 checks passed
@ramonfigueiredo
Copy link
Collaborator

Great job, @anton-ubi . Thank you!

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