Skip to content

Conversation

@StefanRRichter
Copy link
Contributor

Currently, each SafetyNetCloseableRegistry spawns an own ReaperThread. However, this duty could also be fulfilled by a single ReaperThread that is shared by all registries to save unnecessary threads.

This PR makes 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.

PR sits on top or #3229 .

@StefanRRichter StefanRRichter force-pushed the safetyNetSingletonReaperThread branch from 25325ec to 3b6cad4 Compare January 27, 2017 20:10
@StephanEwen
Copy link
Contributor

Quick question about this change: The reaper thread now does not remove the closeables any more from the closeableToRef map. Isn't that a potential memory leak over time?

@Override
public void close() throws IOException {
synchronized (closeableRegistry.getSynchronizationLock()) {
closeableRegistry.closeableToRef.remove(innerCloseable);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removal is done here now, because the reaper thread should not keep/locate right references for all registries

StephanEwen pushed a commit to StephanEwen/flink that referenced this pull request Jan 30, 2017
@asfgit asfgit closed this in ec3eb59 Jan 30, 2017
GEOFBOT pushed a commit to GEOFBOT/flink that referenced this pull request Feb 3, 2017
joseprupi pushed a commit to joseprupi/flink that referenced this pull request Feb 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants