From 24d105f271ae0d07b7eef622e4c80ef6483a0f89 Mon Sep 17 00:00:00 2001 From: Jaime Fullaondo Date: Thu, 12 Nov 2020 02:03:10 +0100 Subject: [PATCH 1/2] [processor] shutdown the executor on cue, dont leak --- .../java/com/timgroup/statsd/StatsDNonBlockingProcessor.java | 4 ---- src/main/java/com/timgroup/statsd/StatsDProcessor.java | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/com/timgroup/statsd/StatsDNonBlockingProcessor.java b/src/main/java/com/timgroup/statsd/StatsDNonBlockingProcessor.java index e28c732d..d959c865 100644 --- a/src/main/java/com/timgroup/statsd/StatsDNonBlockingProcessor.java +++ b/src/main/java/com/timgroup/statsd/StatsDNonBlockingProcessor.java @@ -124,8 +124,4 @@ protected boolean send(final Message message) { return false; } - - void shutdown() { - shutdown = true; - } } diff --git a/src/main/java/com/timgroup/statsd/StatsDProcessor.java b/src/main/java/com/timgroup/statsd/StatsDProcessor.java index eefd4871..0be21257 100644 --- a/src/main/java/com/timgroup/statsd/StatsDProcessor.java +++ b/src/main/java/com/timgroup/statsd/StatsDProcessor.java @@ -147,11 +147,11 @@ public void run() { } boolean isShutdown() { - executor.shutdown(); return shutdown; } void shutdown() { + executor.shutdown(); shutdown = true; } } From 404bfd5c23085a02333c26090572b4c8ae7f8879 Mon Sep 17 00:00:00 2001 From: Jaime Fullaondo Date: Thu, 12 Nov 2020 12:46:55 +0100 Subject: [PATCH 2/2] [processor] shutdown after setting boolean intent --- src/main/java/com/timgroup/statsd/StatsDProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/timgroup/statsd/StatsDProcessor.java b/src/main/java/com/timgroup/statsd/StatsDProcessor.java index 0be21257..600a7913 100644 --- a/src/main/java/com/timgroup/statsd/StatsDProcessor.java +++ b/src/main/java/com/timgroup/statsd/StatsDProcessor.java @@ -151,7 +151,7 @@ boolean isShutdown() { } void shutdown() { - executor.shutdown(); shutdown = true; + executor.shutdown(); } }