Jagadish created SAMZA-890:
------------------------------

             Summary: ThreadFactory used by HttpServer should use Daemon threads
                 Key: SAMZA-890
                 URL: https://issues.apache.org/jira/browse/SAMZA-890
             Project: Samza
          Issue Type: Bug
            Reporter: Jagadish
            Assignee: Jagadish


The Samza HttpServer.scala encapsulates a Jetty Http Server. The default 
constructor of the Jetty Http Server includes a QueuedThreadPool of Non-Daemon 
threads. This has the following problem:

1. If there is a bug/ or an error in the SamzaAppMaster and the SamzaAppMaster 
is shutting down, the threads in the QueuedThreadPool stay alive. The process 
does not terminate as a result. So, even subtle bugs that cause AppMaster 
failures will be magnified because the process will not terminate and merely 
hang. Yarn's RM will not restart the process because the process is still alive.

The fix is to ensure that the QueuedThreadPool creates Daemon threads by 
setting isDaemon to true.

Here's an example of Apache Calcite's HttpServer handling this: 

http://www.programcreek.com/java-api-examples/index.php?source_dir=calcite-master/spark/src/main/java/org/apache/calcite/adapter/spark/HttpServer.java





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to