Skip to content

Commit 6315574

Browse files
committed
fix the validator for anyOf
1 parent 8d8dcb9 commit 6315574

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

sdk/src/main/java/software/amazon/lambda/durable/execution/ExecutionManager.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import java.util.Map;
1212
import java.util.Objects;
1313
import java.util.Set;
14+
import java.util.concurrent.CancellationException;
1415
import java.util.concurrent.CompletableFuture;
1516
import java.util.concurrent.ThreadPoolExecutor;
1617
import java.util.concurrent.TimeUnit;
@@ -293,11 +294,12 @@ private void validateRunningThreads() {
293294
if (userHandlerFuture != null && !userHandlerFuture.isDone()) {
294295
// We wait a few more milliseconds for the last user thread to complete because
295296
// it may have deregistered itself but haven't released the thread yet.
297+
logger.info("Waiting for operation to complete before shutting down: {}", op.getOperationId());
296298
try {
297-
userHandlerFuture.get(100, TimeUnit.MILLISECONDS);
298-
} catch (InterruptedException | TimeoutException e) {
299+
userHandlerFuture.get();
300+
} catch (InterruptedException | CancellationException e) {
299301
// if the user handler is stuck
300-
throw new IllegalStateException("Active running user handler in operation: " + op.getOperationId());
302+
throw new IllegalStateException("Stuck running user handler when shutting down: " + op.getOperationId());
301303
} catch (Exception e) {
302304
// ok if the future completed exceptionally
303305
}

0 commit comments

Comments
 (0)