GitHub user StephanEwen opened a pull request: https://github.com/apache/flink/pull/3548
[FLINK-5962] [checkpoints] Remove scheduled cancel-task from timer queue to prevent memory leaks ## Bug Timer tasks that cancel checkpoints are not eagerly removed from the Timer when checkpoints abort/complete. This can lead to memory leaks in the presence of very frequent checkpoints. ## Changes - This converts the `Timer` to a `ScheduledThreadPoolExecutor` which has the ability to remove canceled timers from the priority queue - The `PendingCheckpoint` now cancels (i.e. removes) the timer when it is disposed (which also happens upon successful completion). ## Tests - Adds checks into the `CheckpointCoordinatorTest` - Adds a test that the timer is canceled in the `PendingCheckpoint` You can merge this pull request into a Git repository by running: $ git pull https://github.com/StephanEwen/incubator-flink timer_leak Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/3548.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3548 ---- ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---