Skip to content

Commit

Permalink
MetricsRegistry unregister fix.
Browse files Browse the repository at this point in the history
NioNetworking can be stopped and started. When this happens, the
IOThreads get re-registered and will overwrite the old probes. This
causes logging noise.

This PR fixes this problem by deregistering the IOThreads when NioNetworking
is shutdown.

(cherry picked from commit 4d9c28e)
  • Loading branch information
pveentjer authored and Matko Medenjak committed Apr 3, 2019
1 parent c66bffb commit cedb1c7
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -230,6 +230,7 @@ public void shutdown() {
shutdown(outputThreads);
outputThreads = null;
closeListenerExecutor.shutdown();
metricsRegistry.deregister(ioBalancer);
}

private void shutdown(NioThread[] threads) {
Expand All @@ -238,6 +239,7 @@ private void shutdown(NioThread[] threads) {
}
for (NioThread thread : threads) {
thread.shutdown();
metricsRegistry.deregister(thread);
}
}

Expand Down

0 comments on commit cedb1c7

Please sign in to comment.