logstash-plugins / logstash-integration-aws

Apache License 2.0
7 stars 17 forks source link

Remove empty temp dirs at plugin startup. #39

Closed mashhurs closed 1 year ago

mashhurs commented 1 year ago

Release notes

[rn:skip]

What does this PR do?

For some environments, especially Windows OS, file scanning (such as antivirus enabled) tools hold temporarily created dirs' IO and a plugin cannot remove the temporarily dir after successfully uploading file to S3. Over time, there will be many empty temp dirs left under the temporary_directory. This PR introduces a logic which, at the Logstash start up, plugin cleans up temporary dirs.

Why is it important/What is the impact to the user?

The users who are facing empty temp dirs left issues get benefit from this automation.

Checklist

Author's Checklist

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

mashhurs commented 1 year ago

🔴 CI is not relative and even re-run doesn't kick new run.

Analyzing the error a bit more provides a clear picture that it is due to docker 8.10 snapshot which uses JRuby 9.3.4.0 and has Concurrent::TimerTask regression. The error coming through stale sweeper initialization: @stale_sweeper = Concurrent::TimerTask.new(:execution_interval => @sweeper_interval) do.