You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by ja...@apache.org on 2018/05/30 03:13:45 UTC

samza git commit: SAMZA-1731: Daemonize threads spawned from SamzaEventHubClientManager.

Repository: samza
Updated Branches:
  refs/heads/master 4187ba953 -> 5534fba33


SAMZA-1731: Daemonize threads spawned from SamzaEventHubClientManager.

**Problem:**
Existing SamzaEventHubClientManager implementation spawns non-daemon threads when instantiating EventHubClient. These non-daemon threads stalls shutdown of samza processes even when the main thread has exited.

**Fix:**
Daemonize threads that are spawned from SamzaEventHubClientManager.

Author: Shanthoosh Venkataraman <sa...@gmail.com>

Reviewers: Jagadish <ja...@apache.org>

Closes #536 from shanthoosh/SAMZA-1731


Project: http://git-wip-us.apache.org/repos/asf/samza/repo
Commit: http://git-wip-us.apache.org/repos/asf/samza/commit/5534fba3
Tree: http://git-wip-us.apache.org/repos/asf/samza/tree/5534fba3
Diff: http://git-wip-us.apache.org/repos/asf/samza/diff/5534fba3

Branch: refs/heads/master
Commit: 5534fba33d461aeff174bdf6d6bee24099cdf388
Parents: 4187ba9
Author: Shanthoosh Venkataraman <sa...@gmail.com>
Authored: Tue May 29 20:13:41 2018 -0700
Committer: Jagadish <jv...@linkedin.com>
Committed: Tue May 29 20:13:41 2018 -0700

----------------------------------------------------------------------
 .../apache/samza/system/eventhub/SamzaEventHubClientManager.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/samza/blob/5534fba3/samza-azure/src/main/java/org/apache/samza/system/eventhub/SamzaEventHubClientManager.java
----------------------------------------------------------------------
diff --git a/samza-azure/src/main/java/org/apache/samza/system/eventhub/SamzaEventHubClientManager.java b/samza-azure/src/main/java/org/apache/samza/system/eventhub/SamzaEventHubClientManager.java
index 22621f3..ee51584 100644
--- a/samza-azure/src/main/java/org/apache/samza/system/eventhub/SamzaEventHubClientManager.java
+++ b/samza-azure/src/main/java/org/apache/samza/system/eventhub/SamzaEventHubClientManager.java
@@ -84,7 +84,7 @@ public class SamzaEventHubClientManager implements EventHubClientManager {
           .setSasKeyName(sasKeyName)
           .setSasKey(sasKey);
 
-      ThreadFactoryBuilder threadFactoryBuilder = new ThreadFactoryBuilder().setNameFormat("Samza EventHubClient Thread-%d");
+      ThreadFactoryBuilder threadFactoryBuilder = new ThreadFactoryBuilder().setNameFormat("Samza EventHubClient Thread-%d").setDaemon(true);
       eventHubClientExecutor = Executors.newFixedThreadPool(numClientThreads, threadFactoryBuilder.build());
       eventHubClient = EventHubClient.createSync(connectionStringBuilder.toString(), retryPolicy, eventHubClientExecutor);
     } catch (IOException | EventHubException e) {