[ https://issues.apache.org/jira/browse/SAMZA-1584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16392076#comment-16392076 ]
ASF GitHub Bot commented on SAMZA-1584: --------------------------------------- GitHub user shanthoosh opened a pull request: https://github.com/apache/samza/pull/441 SAMZA-1584: LocalApplicationRunner.waitForFinish blocks indefinitely. Changes. You can merge this pull request into a Git repository by running: $ git pull https://github.com/shanthoosh/samza SAMZA-1584 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/samza/pull/441.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #441 ---- commit 6ee5195f96b6cd5e4569c71257a810811ec4fc35 Author: Shanthoosh Venkataraman <svenkataraman@...> Date: 2018-03-07T21:49:32Z SAMZA-1584: LocalApplicationRunner.waitForFinish blocks indefinitely. ---- > LocalApplicationRunner.waitForFinish blocks indefinitely. > --------------------------------------------------------- > > 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)