Repository: giraph
Updated Branches:
  refs/heads/trunk 241505905 -> 3c07b123c


Making threads in JobProgressService daemons

Summary: We noticed that sometimes job client doesn't finish because threads in 
JobProgressService are still running. Here we're making them daemons, so that 
if everything else is done, we will be able to finish application.

Test Plan: run test job

Reviewers: majakabiljo, dionysis.logothetis, maja.kabiljo

Reviewed By: maja.kabiljo

Differential Revision: https://reviews.facebook.net/D53829


Project: http://git-wip-us.apache.org/repos/asf/giraph/repo
Commit: http://git-wip-us.apache.org/repos/asf/giraph/commit/3c07b123
Tree: http://git-wip-us.apache.org/repos/asf/giraph/tree/3c07b123
Diff: http://git-wip-us.apache.org/repos/asf/giraph/diff/3c07b123

Branch: refs/heads/trunk
Commit: 3c07b123c22a2fecd875e76371afdaa5a1d5b9fe
Parents: 2415059
Author: Sergey Edunov <[email protected]>
Authored: Fri Feb 26 11:48:08 2016 -0800
Committer: Sergey Edunov <[email protected]>
Committed: Fri Feb 26 11:48:08 2016 -0800

----------------------------------------------------------------------
 .../java/org/apache/giraph/job/JobProgressTrackerService.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/giraph/blob/3c07b123/giraph-core/src/main/java/org/apache/giraph/job/JobProgressTrackerService.java
----------------------------------------------------------------------
diff --git 
a/giraph-core/src/main/java/org/apache/giraph/job/JobProgressTrackerService.java
 
b/giraph-core/src/main/java/org/apache/giraph/job/JobProgressTrackerService.java
index 6949feb..4898cfa 100644
--- 
a/giraph-core/src/main/java/org/apache/giraph/job/JobProgressTrackerService.java
+++ 
b/giraph-core/src/main/java/org/apache/giraph/job/JobProgressTrackerService.java
@@ -115,6 +115,7 @@ public class JobProgressTrackerService implements 
JobProgressTracker {
         }
       }
     });
+    writerThread.setDaemon(true);
     writerThread.start();
   }
 
@@ -132,7 +133,7 @@ public class JobProgressTrackerService implements 
JobProgressTracker {
         GiraphConstants.MAX_ALLOWED_JOB_TIME_MS.get(conf);
     if (maxAllowedJobTimeMs > 0) {
       // Start a thread which will kill the job if running for too long
-      new Thread(new Runnable() {
+      Thread killThread = new Thread(new Runnable() {
         @Override
         public void run() {
           try {
@@ -151,7 +152,9 @@ public class JobProgressTrackerService implements 
JobProgressTracker {
             }
           }
         }
-      }).start();
+      });
+      killThread.setDaemon(true);
+      killThread.start();
     }
   }
 

Reply via email to