Skip to content

Commit

Permalink
clear waits
Browse files Browse the repository at this point in the history
  • Loading branch information
coderzc committed Nov 17, 2021
1 parent 3a810a8 commit df61a96
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,11 @@ public String log(String jobId, int containerId, long offset, long length,

@Override
public void close() {
for (String jobId : this.waits.keySet()) {
this.waits.get(jobId).getKey().cancel(true);
}
this.waits.clear();

if (this.watch != null) {
this.watch.close();
this.watchActive.setFalse();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,11 @@ public void testWatchJobAndCancel() throws ExecutionException,
this.driver.watchJob(jobId, params, jobObserver);

this.driver.cancelJob(jobId, params);
this.driver.watchJob(jobId, params, jobObserver).get();
CompletableFuture<Void> watchJob = this.driver.watchJob(jobId, params,
jobObserver);
if (watchJob != null) {
watchJob.get();
}
}

@Test
Expand Down

0 comments on commit df61a96

Please sign in to comment.