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

Hitesh Shah commented on TEZ-919:
---------------------------------

{code}
+  private void cleanupCurrentConnection() {
+    // Synchronizing on isAtive to ensure we don't run into a parallel close
+    // Can't synchronize on the main class itself since that would cause the
+    // shutdown request to block
+    synchronized (cleanupLock) {
{code}
     - code and comment dont match up. 

bq. this.stopped = true;
   - does this need to be an atomic boolean? It seems to be used as a check in 
quite a few places

bq. +    // TODO Auto-generated constructor stub
  - remove TODOs in new exception ? 

{code}
+  public void shutdown() {
+    if (!isShutDown.getAndSet(true)) {
+      shutdownInternal();
+    }
+  }
+
+  private void shutdownInternal() {
+    // Synchronizing on isShutDown to ensure we don't run into a parallel close
+    // Can't synchronize on the main class itself since that would cause the
+    // shutdown request to block
+    synchronized (isShutDown) {
{code}
   - why does shutdown() have a check for gating multiple calls? But calling 
shutdownInternal() multiple times is allowed? 

Looks good otherwise.







> Fix shutdown handling for Shuffle (regular and broadcast)
> ---------------------------------------------------------
>
>                 Key: TEZ-919
>                 URL: https://issues.apache.org/jira/browse/TEZ-919
>             Project: Apache Tez
>          Issue Type: Bug
>            Reporter: Siddharth Seth
>            Assignee: Siddharth Seth
>         Attachments: TEZ-919.1.txt
>
>
> Split from TEZ-711. Shutting down ShuffledInput and ShuffledUnsortedInput 
> needs some work.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to