Skip to content

Add poller group ID tracking across all poller types#2254

Draft
tconley1428 wants to merge 4 commits intomasterfrom
poller-group-id-sdk-go
Draft

Add poller group ID tracking across all poller types#2254
tconley1428 wants to merge 4 commits intomasterfrom
poller-group-id-sdk-go

Conversation

@tconley1428
Copy link
Copy Markdown

Summary

  • Add pollerGroupTracker that distributes poll requests across server-provided poller groups using weighted random selection, prioritizing groups with zero pending polls
  • Integrate tracker into workflow, activity, and nexus task pollers: set PollerGroupId on poll requests and update groups from poll responses
  • Forward PollerGroupId from poll responses to RespondQueryTaskCompleted, RespondNexusTaskCompleted, and RespondNexusTaskFailed for proper routing

Depends on API changes from temporalio/api#744

Test plan

  • Unit tests for pollerGroupTracker (zero-pending prioritization, weighted distribution, release, group updates)
  • Unit tests for weightedRandom (single candidate, zero weights, convergence)
  • Integration tests verifying PollerGroupId is empty on first poll, set on subsequent polls for all three poller types
  • Integration tests verifying PollerGroupId forwarding on query responses (success and error paths)
  • Integration tests verifying PollerGroupId forwarding on nexus completion and failure (via full Execute path)
  • Integration test for GRPC-too-large query response fallback path

🤖 Generated with Claude Code

tconley1428 and others added 4 commits March 25, 2026 15:56
Integrate poller group assignment across all three poller types. On each
poll, the SDK selects a group ID via weighted random distribution from
server-provided poller groups and sets it on the request. Groups from
poll responses update the tracker. The response poller_group_id is
forwarded on RespondQueryTaskCompleted, RespondNexusTaskCompleted, and
RespondNexusTaskFailed for proper routing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests cover poll request/response flow for all three poller types,
PollerGroupId forwarding on query and nexus respond RPCs, and the
GRPC-too-large fallback path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# Conflicts:
#	internal/internal_nexus_task_poller.go
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