[SPARK-3562]Periodic cleanup event logs

link #2391 
What's this synchronization trying to achieve?

If there's really a need for the two tasks to never run concurrently, I'd say it's better to use a `ScheduledExecutorService` with a single worker thread.