Skip to content

Commit ac3526b

Browse files
Avoid warning from un-accessed operation promise (#2280)
1 parent 25f5536 commit ac3526b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

temporal-sdk/src/main/java/io/temporal/internal/sync/SyncWorkflowContext.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,11 @@ public <R> ExecuteNexusOperationOutput<R> executeNexusOperation(
817817
? dataConverter.fromPayload(
818818
b.get(), input.getResultClass(), input.getResultType())
819819
: null);
820+
// We register an empty handler to make sure that this promise is always "accessed" and never
821+
// leads to a log about it being completed exceptionally and non-accessed.
822+
// The "main" operation promise is the one returned from the execute method and that
823+
// promise will always be logged if not accessed.
824+
operationPromise.handle((ex, failure) -> null);
820825
return new ExecuteNexusOperationOutput<>(result, operationPromise);
821826
}
822827

0 commit comments

Comments
 (0)