File tree Expand file tree Collapse file tree
temporal-sdk/src/main/java/io/temporal/internal/worker Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,12 +98,18 @@ public ActivityTask poll() {
9898 PollActivityTaskQueueResponse response ;
9999 SlotPermit permit ;
100100 boolean isSuccessful = false ;
101- CompletableFuture <SlotPermit > future =
102- slotSupplier .reserveSlot (
103- new SlotReservationData (
104- pollRequest .getTaskQueue ().getName (),
105- pollRequest .getIdentity (),
106- pollRequest .getWorkerVersionCapabilities ().getBuildId ()));
101+ CompletableFuture <SlotPermit > future ;
102+ try {
103+ future =
104+ slotSupplier .reserveSlot (
105+ new SlotReservationData (
106+ pollRequest .getTaskQueue ().getName (),
107+ pollRequest .getIdentity (),
108+ pollRequest .getWorkerVersionCapabilities ().getBuildId ()));
109+ } catch (Exception e ) {
110+ log .warn ("Error while trying to reserve a slot for an activity" , e .getCause ());
111+ return null ;
112+ }
107113 try {
108114 permit = future .get ();
109115 } catch (InterruptedException e ) {
You can’t perform that action at this time.
0 commit comments