Skip to content

Dedup retried Nexus signals - #3180

Draft
atol wants to merge 1 commit into
mainfrom
alicelin/NEXUS-943/signal-dedup
Draft

atol wants to merge 1 commit into
mainfrom
alicelin/NEXUS-943/signal-dedup

Conversation

@atol

@atol atol commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

What was changed

  • Signals and Signal-With-Starts sent through TemporalNexusClient.getWorkflowClient() in a @TemporalOperation handler now reuse the Nexus operation's request ID.
  • Breaking (experimental API): each handler run can send only one such signal; a second throws a BAD_REQUEST error. Signal-With-Start counts toward the limit; a failed signal doesn't; a retried Nexus task starts with a fresh limit.
  • Breaking (experimental API): Signal-With-Start from such a handler requires an explicit workflow ID.
  • Nexus.getOperationContext().getWorkflowClient() returns the same client, so signals sent through it from a @TemporalOperation handler are covered too. Signals from other Nexus handlers (e.g. OperationHandler.sync, WorkflowRunOperation), or from threads other than the handler thread, are unchanged.
  • Based on De-duplicate Nexus Signal and SignalWithStart operations sdk-go#2781.

Why?

When a Nexus task is retried, the handler reruns and sends its signal again with a new random request ID, so the workflow receives it twice. Reusing the operation's request ID lets the server dedupe the retry. However, every signal in one handler run then shares that ID, so a second signal to the same workflow would be silently dropped while reported as delivered. Limiting each run to one signal turns that silent loss into a clear error. Signal-With-Start also requires an explicit workflow ID, since a generated one would differ on each retry and start a second workflow instead of deduping.

Checklist

  1. How was this tested:
    Added unit and integration tests.

  2. Any docs updates needed?
    No.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant