[ 
https://issues.apache.org/jira/browse/SAMZA-1220?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jagadish updated SAMZA-1220:
----------------------------
    Description: 
[~jagadish1...@gmail.com] and I were recently looking at a thread dump for a 
SamzaContainer that had deadlocked during the shutdown sequence. We noticed a 
couple of issues:

1. Adding a thread name to the shutdown hook thread will make debugging easier.
2. The shutdown hook thread's thread group is main's thread group. Main's 
default uncaught exception handler calls System.exit() in LocalContainerRunner. 
This leads to a deadlock if the shutdown hook throws an exception. We can 
either catch and ignore these exceptions or create a new thread group for it.
3. Port the internal patch that removes the previously registered shutdown 
hook. (this helps avoid potential memory leaks)

  was:
[~jagadish1...@gmail.com] and I were recently looking at a thread dump for a 
SamzaContainer that had deadlocked during the shutdown sequence. We noticed a 
couple of issues:

1. Adding a thread name to the shutdown hook thread will make debugging easier.
2. The shutdown hook thread's thread group is main's thread group. Main's 
default uncaught exception handler calls System.exit() in LocalContainerRunner. 
This leads to a deadlock if the shutdown hook throws an exception. We can 
either catch and ignore these exceptions or create a new thread group for it.


> Add thread name to SamzaContainer shutdown hook and prevent shutdown deadlock
> -----------------------------------------------------------------------------
>
>                 Key: SAMZA-1220
>                 URL: https://issues.apache.org/jira/browse/SAMZA-1220
>             Project: Samza
>          Issue Type: Bug
>            Reporter: Prateek Maheshwari
>            Assignee: Navina Ramesh
>             Fix For: 0.13.0
>
>
> [~jagadish1...@gmail.com] and I were recently looking at a thread dump for a 
> SamzaContainer that had deadlocked during the shutdown sequence. We noticed a 
> couple of issues:
> 1. Adding a thread name to the shutdown hook thread will make debugging 
> easier.
> 2. The shutdown hook thread's thread group is main's thread group. Main's 
> default uncaught exception handler calls System.exit() in 
> LocalContainerRunner. This leads to a deadlock if the shutdown hook throws an 
> exception. We can either catch and ignore these exceptions or create a new 
> thread group for it.
> 3. Port the internal patch that removes the previously registered shutdown 
> hook. (this helps avoid potential memory leaks)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to