GitHub user StefanRRichter opened a pull request:
FLINK-5663 Prevent leaking SafetyNetCloseableRegistry though InheritableThreadLocal
This PR prevents the `SafetyNetCloseableRegistry` from leaking into pooled threads through `InheritableThreadLocal`.
As first step, we use `ThreadLocal` instead of `InheritableThreadLocal` to hold the closeable registries.
Additionally, we also create safety nets for the file system at the scope of the checkpointing thread. We hope that this covers already covers most cases. Other threads could actually also create safety nets for their scope right now.
As a last change, we made the reaper thread a singleton, because we could potentially create more registries now and it is not required to have one reaper thread per registry.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/StefanRRichter/flink safetyNet2
Alternatively you can review and apply these changes as the patch at:
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #3228
Author: Stefan Richter <email@example.com>
FLINK-5663 Prevent leaking safetynet closeable registry