Skip to content

Fix paginated workflow task completions - #3177

Open
jmaeagle99 wants to merge 2 commits into
mainfrom
fix-wft-pagination-retry-options
Open

jmaeagle99 wants to merge 2 commits into
mainfrom
fix-wft-pagination-retry-options

Conversation

@jmaeagle99

@jmaeagle99 jmaeagle99 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What changed?

  • RpcRetryOptions.Builder(RpcRetryOptions) now copies the source options' doNotRetry list
    instead of reusing it.
  • The sdk-java dev-server test profile now enables history.enableWorkflowTaskCompletionPagination
    and raises system.transactionSizeLimit to 32 MiB.
  • Added RpcRetryOptionsTest.aBuilderCopiedFromOptionsCanAddDoNotRetryItems and a Fixed
    CHANGELOG entry.

Why?

Workflow task completion pagination (#3051) is broken due to a bug in RpcRetryOptions builder. Pagination builds its retry options with
RpcRetryOptions.newBuilder(builtOptions).addDoNotRetry(ABORTED, WorkflowTaskCompletionBufferLostFailure.class).
RpcRetryOptions stores doNotRetry as an unmodifiable list, and the copy builder reused that list, so addDoNotRetry always threw UnsupportedOperationException. It threw before the first page was sent. On a namespace with pagination enabled, every completion that needed pagination failed, and the workflow task timed out on every attempt.

Any application calling RpcRetryOptions.newBuilder(existing).addDoNotRetry(...) hit the same exception.

CI never caught this because WorkflowTaskCompletionPaginationIntegrationTest skips unless the namespace advertises the capability, and the server flag defaults to false. The dev-server flags make that test run. The larger transaction size limit is needed because the server stores the reassembled completion in a single write.

Checklist

  1. How this was tested:
  • Against the dev server with the new flags, WorkflowTaskCompletionPaginationIntegrationTest passes. With only the RpcRetryOptions change reverted, it hangs until the test timeout and logs UnsupportedOperationException from addDoNotRetry.
  • GrpcMessageTooLargeTest and the io.temporal.payload tests pass on the dev server with the new flags.
  • RpcRetryOptionsTest and WorkflowWorkerTest pass.
  1. Any docs updates needed? No. Added fixed change log entry.

@Quinn-With-Two-Ns Quinn-With-Two-Ns self-assigned this Oct 29, 2026
Sending a paginated completion threw UnsupportedOperationException
before the first page went out. sendPaginatedTaskCompleted extends
built RpcRetryOptions with addDoNotRetry, but a builder copied from
built options reused their unmodifiable doNotRetry list. Copy the list
so a copied builder can be extended without changing the source
options.

Enable workflow task completion pagination on the dev server used by
the tests, and raise its transaction size limit above the recombined
completion, so WorkflowTaskCompletionPaginationIntegrationTest runs
instead of always skipping.
@jmaeagle99
jmaeagle99 force-pushed the fix-wft-pagination-retry-options branch from e61119c to edd94d4 Compare October 30, 2026 22:11

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.

2 participants