Skip to content

feat!(extstore): add new concurrency controls for external storage. - #3114

Open
cconstable wants to merge 2 commits into
mainfrom
extstore-concurrency-controls
Open

cconstable wants to merge 2 commits into
mainfrom
extstore-concurrency-controls

Conversation

@cconstable

@cconstable cconstable commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

What was changed

ExternalStorage now has a Concurrency field with two limits:

  • MaxDriverOperations caps requests in flight across every driver on that ExternalStorage instance.
  • MaxOperationsPerMessage caps requests for a single message (workflow task, etc). Each message gets its own budget.

Both are limits are cooperative. Drivers receive a Limiter on the store and retrieve contexts and must wrap each request in Permit. Requests made outside a permit are not counted, and a warning is logged when a driver completes without taking one.

context
    .getLimiter()
    .permit(
        payload,
        () -> { /* store/retrieve logic */ });

Removed WorkerOptions.MaxConcurrentWorkflowTaskExternalStorageVisits. The payload visitor now walks all payload sites in a message concurrently, since the two limits above do the bounding. The bundled S3 and GCS drivers take permits, and the GCS driver's hardcoded limit of 10 is gone.

Why?

The previous control bounded payload visits (not storage operations or driver calls) which was a bit unintuitive and left driver fanout unbounded (e.g. setting the previous limit to 3 did not limit concurrent external storage requests to 3). It also only applied to workflow tasks, leaving client, activity, and Nexus paths unbounded.

Checklist

Added new tests.

@cconstable
cconstable requested a review from a team as a code owner October 2, 2026 00:46

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