Skip to content

Add SUGGEST_CONTINUE_AS_NEW_REASON_TOO_MANY_SIGNALS enum value#822

Open
nitishagar wants to merge 1 commit into
temporalio:mainfrom
nitishagar:nitishagar/10941-suggest-can-signals
Open

Add SUGGEST_CONTINUE_AS_NEW_REASON_TOO_MANY_SIGNALS enum value#822
nitishagar wants to merge 1 commit into
temporalio:mainfrom
nitishagar:nitishagar/10941-suggest-can-signals

Conversation

@nitishagar

Copy link
Copy Markdown

What changed?

Adds a new value to the SuggestContinueAsNewReason enum:

SUGGEST_CONTINUE_AS_NEW_REASON_TOO_MANY_SIGNALS = 5;

placed after the existing reserved 4 block, following the file's enum-ordering style.

Why?

Resolves the API/proto portion of temporalio/temporal#10941.

Today the server has a hard limit on signals (maximumSignalsPerExecution, default 10000) that rejects new signals outright via ErrSignalsLimitExceeded, but no soft suggest-continue-as-new pathway that warns the worker before the hard limit bites — unlike history size, history event count, and updates, which all already have a corresponding SuggestContinueAsNewReason.

This PR adds only the enum value. The server-side companion PR wires it into the suggest computation (a new namespace-scoped threshold config key), the metric tag, and the persisted/SDK-visible reasons field. This mirrors how TOO_MANY_UPDATES came to exist upstream before the server consumed it.

Breaking changes

None. Appending a new enum value to a proto3 enum is wire-compatible (the persisted WorkflowTaskSuggestContinueAsNewReasons is a repeated int32; older readers round-trip the unknown int, regenerated SDKs see the named constant). No existing value changes.

Server PR

temporalio/temporal#10941 (companion server PR to follow this merge): adds the history.maximumSignalsPerExecution.suggestContinueAsNewThreshold dynamic-config key, the inline suggest computation in workflow_task_state_machine.go, the SuggestContinueAsNewReasonTooManySignals metric tag, and tests. The feature defaults to disabled (threshold 0), so it is a strict no-op for any deployment that does not opt in.

Add a new SuggestContinueAsNewReason value so the server can advise a
workflow to continue-as-new when its signal count approaches
maximumSignalsPerExecution, before the hard ErrSignalsLimitExceeded
rejection. This is the signals analog of the existing
TOO_MANY_UPDATES reason.
@nitishagar nitishagar requested review from a team July 9, 2026 03:43
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Nitish Agarwal seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

nitishagar pushed a commit to nitishagar/temporal that referenced this pull request Jul 9, 2026
Add a fourth SuggestContinueAsNewReason, TOO_MANY_SIGNALS, so the server
advises a workflow to continue-as-new when its signal count reaches a
configurable fraction of maximumSignalsPerExecution, before the hard
ErrSignalsLimitExceeded rejection bites. This is the signals analog of
the existing TOO_MANY_UPDATES suggest-CAN feature.

The suggestion is computed inline in getHistorySizeInfo alongside the
existing history-size and history-event-count reasons (signals have no
registry, so inline computation reuses the scope already established
there). It fires when SignalCount >= ceil(maximumSignalsPerExecution *
threshold), mirroring the updates path's rounding.

The threshold is a new namespace-scoped dynamic-config key
history.maximumSignalsPerExecution.suggestContinueAsNewThreshold that
defaults to 0 (disabled), so the feature is opt-in and a strict no-op on
upgrade. The hard-limit rejection path is unchanged.

Requires go.temporal.io/api to export
SUGGEST_CONTINUE_AS_NEW_REASON_TOO_MANY_SIGNALS (added in temporalio/api#822);
go.mod temporarily points at a fork until that version is released.

Closes temporalio#10941.
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.

2 participants