-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Issue with log purging when FileChannel compression is enabled #2439
Comments
Hi, |
This issue is stale because it has been open for 365 days with no activity. |
@preranamkhare, do you get this issue in Linux. It was reported for Windows. |
Reproducible with Poco 1.13 on macOS 14.2. |
Root of the problem is that renaming, deletion and creating compressed files is handled independently in two threads inside The situation is even worse with numbered files because it is more likely that compression will try to process one of the files that is being renamed due to log rotation. |
I see two possibilities to solve this issue:
|
Additional investigation shows that PurgeStrategy would have to be synchronised with log file rotation and compression. |
Expected behavior
Expect that rotated log count is consistent when compression enabled.
Actual behavior
When FileChannel compression is enabled, we sometimes see too many files being retained, or too little. Issues occurs around 1 in 20 runs.
Steps to reproduce the problem
-Open new FileChannel (flush false, 1 M rotation, 3 purge count, archive timestamp, times local, compress true)
-Log x1024 1Kb messages 5 times
-Close fine channel
-Expected current log and 3 compressed archives - actually sometimes seeing 2 archives, and sometimes 5
Example code to reproduce -
POCO version
1.7.9
Compiler and version
VS2017 / v141
Operating system and version
Windows 10
Other relevant information
The text was updated successfully, but these errors were encountered: