You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by "Shanthoosh Venkataraman (JIRA)" <ji...@apache.org> on 2018/03/09 04:00:00 UTC

[jira] [Commented] (SAMZA-1584) Improve SamzaContainer shutdown sequence in StreamProcessor.

    [ https://issues.apache.org/jira/browse/SAMZA-1584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16392369#comment-16392369 ] 

Shanthoosh Venkataraman commented on SAMZA-1584:
------------------------------------------------

-  PR 441 in github does the option 1.

> Improve SamzaContainer shutdown sequence in StreamProcessor.
> ------------------------------------------------------------
>
>                 Key: SAMZA-1584
>                 URL: https://issues.apache.org/jira/browse/SAMZA-1584
>             Project: Samza
>          Issue Type: Bug
>            Reporter: Shanthoosh Venkataraman
>            Assignee: Shanthoosh Venkataraman
>            Priority: Major
>
> Recommended solution to kill streamApplication in standalone is the following:
> {code:java}
> LocalApplicationRunner.kill(streamApp);
> LocalApplicationRunner.waitForFinish();{code}
> `LocalApplicationRunner.kill(streamApplication)` invokes `StreamProcessor.stop()` and  `StreamProcessor.stop()` invokes `SamzaContainer.shutdown()` to kill the samza-container. 
> `SamzaContainer.shutdown()` marks the shutdown flag of `AsyncRunLoop` and shutdown flag will be taken into account by `AsyncRunLoop` when it chooses the next message to route to tasks. 
> Actual shutdown sequence of StreamProcessor and ZkJobCoordinator is triggered on SamzaContainerListener.onContainerStop() callback which is fired when the SamzaContainer is completely shutdown. LocalApplication.awaitForFinish() will block forever in following two scenarios:
>  * If any of the AsyncRunLoop operation(commit, window, process) is going on indefinitely, then the marked shutdown flag will not be seen by the AsyncRunLoop.
>  * If any step in the SamzaContainer shutdown sequence blocks indefinitely.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)