livy-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vanzin <...@git.apache.org>
Subject [GitHub] incubator-livy pull request #128: [LIVY-533] Use setJobGroup/cancelJobGroup ...
Date Wed, 28 Nov 2018 22:13:49 GMT
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/incubator-livy/pull/128#discussion_r237282583
  
    --- Diff: rsc/src/main/java/org/apache/livy/rsc/driver/JobWrapper.java ---
    @@ -39,20 +39,27 @@
     
       private final RSCDriver driver;
       private final Job<T> job;
    -  private final AtomicInteger completed;
     
    -  private Future<?> future;
    +  private volatile Future<?> future;
     
       public JobWrapper(RSCDriver driver, String jobId, Job<T> job) {
         this.driver = driver;
         this.jobId = jobId;
         this.job = job;
    -    this.completed = new AtomicInteger();
       }
     
       @Override
       public Void call() throws Exception {
         try {
    +      // this is synchronized to avoid races with cancel()
    --- End diff --
    
    `future` will be null before `submit` is called. What if `cancel` is called before `submit`
is called?
    
    That's my question.


---

Mime
View raw message