Skip reactivation signals for current/ramping/draining versions#9778
Open
Skip reactivation signals for current/ramping/draining versions#9778
Conversation
Reactivation signals were being sent to version workflows for all pinned versions, including those that are CURRENT, RAMPING, or DRAINING. While the version workflow handler already ignored these signals, they still created unnecessary RPCs and added events to the workflow history. This change piggybacks on the existing CheckTaskQueueVersionMembership matching RPC to also return whether the version is drained or inactive. The matching service already loads the full deployment data but previously discarded the version status. The new VersionReactivationEligibility message in the response uses a proto message wrapper to provide nil semantics for backwards compatibility during rolling deploys. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ld format check - Rename checkTaskQueueVersionMembership → checkVersionMembershipAndReactivationEligibility - Rename validatePinnedVersionInTaskQueue → validateVersionAndGetReactivationEligibility - Rename ValidateVersioningOverride → ValidateVersioningOverrideAndGetReactivationEligibility - Fix cache comment: "whether the task queue exists in the version" - Add old format (deprecated versions list) check to IsVersionDrainedOrInactive - Improve proto comment explaining why only drained/inactive versions get signals - Improve validatePostResetOperationInputs comment about per-operation eligibility Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Skip deleted versions (return nil) in IsVersionDrainedOrInactive, consistent with how HasDeploymentVersion treats deleted versions as absent. This prevents sending reactivation signals to deleted version workflows. - Add dedicated TestIsVersionDrainedOrInactive covering: nil deployments, not found, DRAINED, INACTIVE, CURRENT, RAMPING, deleted (new format), and old format (DRAINED, CURRENT). Co-Authored-By: Claude Opus 4.6 (1M context) <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.
Summary
CheckTaskQueueVersionMembershipmatching RPC response with aVersionReactivationEligibilitymessage that indicates whether the version is drained or inactiveValidateVersioningOverride→ call sites →ReactivateVersionWorkflowIfPinnedto skip signals for versions that don't need reactivationKey changes
VersionReactivationEligibilitymessage andreactivation_eligibilityfield toCheckTaskQueueVersionMembershipResponseIsVersionDrainedOrInactivehelperReactivateVersionWorkflowIfPinnedskips signal when matching confirms version is NOT drained/inactiveVersionMembershipCacherenamed toVersionMembershipAndReactivationStatusCache, now also caches the reactivation eligibility statusBackwards/forwards compatibility
Test plan
ValidateVersioningOverride— cache hit (drained/active), RPC (drained/active/old matching), fallback pathGetIsWFTaskQueueInVersionDetector— cache and RPC pathsTestUpdateWorkflowExecutionOptions_ReactivateVersionOnPinnedTestStartWorkflowExecution_ReactivateVersionOnPinnedTestStartWorkflowExecution_ReactivateVersionOnPinned_WithConflictPolicyTestSignalWithStartWorkflowExecution_ReactivateVersionOnPinnedTestResetWorkflowExecution_ReactivateVersionOnPinnedTestReactivationSignalCache_Deduplication_StartWorkflowTestReactivationSignalCache_Deduplication_SignalWithStartTestReactivationSignalCache_Deduplication_UpdateOptionsTestReactivationSignalCache_Deduplication_Reset🤖 Generated with Claude Code
Note
Medium Risk
Touches cross-service worker versioning flow (proto + matching + history) and changes when reactivation signals are emitted; incorrect eligibility computation could suppress needed signals or cause extra ones during rolling upgrades.
Overview
Extends
CheckTaskQueueVersionMembershipResponsewith optionalreactivation_eligibility(newVersionReactivationEligibilitymessage) so callers can know if a version is drained/inactive.Threads this eligibility through worker-versioning validation and caching (renaming
VersionMembershipCachetoVersionMembershipAndReactivationStatusCache) and updates history start/signal-with-start/reset/update-options paths to skipReactivateVersionWorkflowIfPinnedsignals when matching confirms the version is not drained/inactive (nil/absent preserves backwards-compatible “signal unconditionally” behavior).Reviewed by Cursor Bugbot for commit 6e53f2d. Bugbot is set up for automated code reviews on this repo. Configure here.