Skip to content

Commit

Permalink
Preserve the thread's interrupted status when the task completes.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisr3 authored and rohanKanojia committed Sep 29, 2020
1 parent 2b241ee commit f3f4a3a
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ public List<HasMetadata> waitUntilCondition(Predicate<HasMetadata> condition,
futures.add(CompletableFuture.supplyAsync(() -> {
try {
return h.waitUntilCondition(client, config, meta.getMetadata().getNamespace(), meta, condition, amount, timeUnit);
} catch (InterruptedException e) {
// Don't forget that this thread was interrupted.
Thread.currentThread().interrupt();

//consider all errors as not ready.
logAsNotReady(e, meta);
return null;
} catch (Exception e) {
//consider all errors as not ready.
logAsNotReady(e, meta);
Expand Down

0 comments on commit f3f4a3a

Please sign in to comment.