Implement new task queue kind to send worker commands#9899
Open
Implement new task queue kind to send worker commands#9899
Conversation
Replace Kind() == STICKY checks with IsEphemeral() where the behavior applies to all ephemeral partition types (sticky, and future types like worker-commands), not just sticky queues specifically. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
6fd76ef to
872065b
Compare
7d9ffcf to
a51f55b
Compare
This was referenced Apr 10, 2026
a163283 to
2b99d6a
Compare
a51f55b to
d3d045d
Compare
…ants These are used in IsEphemeral() code paths that apply to all ephemeral partition types, not just sticky queues. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2b99d6a to
8e2ff4f
Compare
d3d045d to
6a515ee
Compare
81d28e9 to
fb145ab
Compare
a1a9cca to
994395c
Compare
Replace the single IsEphemeral() method on the Partition interface with four specific property methods: HasTTLExpiry(), SupportsFairness(), SupportsVersioning(), and SupportsPartitions(). Each call site now uses the property that governs its behavior, making it clearer why a check exists and easier to set correct values for new partition types. PartitionCount() returns 1 when SupportsPartitions() is false, enforcing the single-partition constraint explicitly. Describe task queue checks use Kind() == NORMAL since only user-facing queues can be described — this is about the queue's visibility, not a specific property. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
994395c to
2a7094c
Compare
fb145ab to
5f7413c
Compare
dnr
reviewed
Apr 15, 2026
…k for load-on-demand Replace HasTTLExpiry() bool with PersistenceTTL() time.Duration so partition types own their TTL values. Use explicit Kind() != STICKY check for the load-on-demand decision since that is specific to sticky queue semantics, not a general property of partitions with TTL. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move partition metric label from type assertions in metrics helpers to the Partition interface, so each partition kind defines its own label. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the SDK sets Kind=TASK_QUEUE_KIND_WORKER_COMMANDS, the server now creates a WorkerCommandsPartition (similar to StickyPartition). Metrics for these partitions get partition=__worker_commands__ and the taskqueue tag is suppressed to __omitted__ to prevent cardinality explosion from per-worker queue names. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update API dep to include TASK_QUEUE_KIND_WORKER_COMMANDS enum. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
37523af to
a57d54a
Compare
The existing metrics framework already handles task queue name cardinality via the taskQueueBreakdown parameter. Also add staticcheck to nolint directives for NamespaceId and RpcName methods. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Regenerate proto import map to include the callback/v1 proto added in the API dependency bump. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ShahabT
reviewed
Apr 15, 2026
The name field was always identical to taskQueue.Name() since worker-commands queues have no separate identity like sticky queues do. Add tests for PartitionFromProto with WORKER_COMMANDS kind and for partition property methods. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…s-partition-metrics # Conflicts: # common/metrics/task_queues.go # common/tqid/task_queue_id.go # go.mod # go.sum # service/matching/db.go # service/matching/matching_engine.go
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add support for
TASK_QUEUE_KIND_WORKER_COMMANDSin the matching service. This is a new task queue kind for server-to-worker communication (e.g. activity cancellations), represented by a newWorkerCommandsPartitiontype in thetqidpackage — analogous to howStickyPartitionrepresents sticky queues.Also adds a distinct
partitionmetric tag for worker-commands queues so their traffic can be distinguished from user-facing normal queues in metrics.Depends on #9900.
Why
Worker_Commands queue kind has different properties compared to a normal user defined queue.
We also want to distinguish metrics for internally created queues from user-facing normal queues.
How did you test it?
Unit tests covering metric tag generation for normal, sticky, and worker-commands partitions.
🤖 Generated with Claude Code