File tree Expand file tree Collapse file tree
sdk/src/main/java/software/amazon/lambda/durable/execution Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111import java .util .Map ;
1212import java .util .Objects ;
1313import java .util .Set ;
14+ import java .util .concurrent .CancellationException ;
1415import java .util .concurrent .CompletableFuture ;
1516import java .util .concurrent .ThreadPoolExecutor ;
1617import 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 }
You can’t perform that action at this time.
0 commit comments