Ensure active future is always completed

This commit is contained in:
Chris Eager
2021-07-01 12:43:17 -05:00
committed by Chris Eager
parent d5b0d99a54
commit 530b2a310f
2 changed files with 14 additions and 11 deletions

View File

@@ -107,8 +107,11 @@ public abstract class ManagedPeriodicWork implements Managed {
Util.sleep(sleepDurationAfterUnexpectedException.toMillis());
} finally {
lock.releaseActiveWork(workerId);
activeExecutionFuture.get().complete(null);
try {
lock.releaseActiveWork(workerId);
} finally {
activeExecutionFuture.get().complete(null);
}
}
}
}