From 09357297e283d72eea288cf91e383d1fdfb3d9f3 Mon Sep 17 00:00:00 2001 From: Mark Payne Date: Thu, 21 Jan 2016 12:00:40 -0500 Subject: [PATCH] NIFI-259: Ensured that thread pools were being shutdown properly --- .../nifi/remote/client/socket/EndpointConnectionPool.java | 1 + .../state/providers/local/WriteAheadLocalStateProvider.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/socket/EndpointConnectionPool.java b/nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/socket/EndpointConnectionPool.java index 81ca70da54..0dde17dca7 100644 --- a/nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/socket/EndpointConnectionPool.java +++ b/nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/socket/EndpointConnectionPool.java @@ -182,6 +182,7 @@ public class EndpointConnectionPool { public Thread newThread(final Runnable r) { final Thread thread = defaultFactory.newThread(r); thread.setName("NiFi Site-to-Site Connection Pool Maintenance"); + thread.setDaemon(true); return thread; } }); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/state/providers/local/WriteAheadLocalStateProvider.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/state/providers/local/WriteAheadLocalStateProvider.java index ba8e4d9da9..7d16a10fbe 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/state/providers/local/WriteAheadLocalStateProvider.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/state/providers/local/WriteAheadLocalStateProvider.java @@ -129,6 +129,8 @@ public class WriteAheadLocalStateProvider extends AbstractStateProvider { @Override public synchronized void shutdown() { + executor.shutdown(); + try { writeAheadLog.shutdown(); } catch (final IOException ioe) {