Skip to content

Commit ad55a1c

Browse files
authored
fix(shard-distributor): prevent context cancellation in streaming WatchNamespaceState RPC (#7474)
**What changed?** Added `sharddistributorClient.WatchNamespaceState` to the `noTimeoutAPIs` list in the timeout wrapper template and regenerated the wrapper code. **Why?** The timeout wrapper was immediately cancelling the context for streaming RPCs, causing `WatchNamespaceState` streams to fail with "context canceled" errors. For streaming RPCs, the context must remain alive for the stream's entire lifetime, not just the initial call. **How did you test it?** Verified locally that WatchNamespaceState streams now remain open without premature cancellation. **Potential risks** Low risk. This only affects the WatchNamespaceState streaming RPC, allowing it to stay open as intended rather than being cancelled immediately. **Release notes** **Documentation Changes** None Signed-off-by: Jakob Haahr Taankvist <[email protected]>
1 parent 199e5fb commit ad55a1c

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

client/templates/timeout.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{{ $Decorator := (printf "%s%s" $ClientName .Interface.Name) }}
66
{{$largeTimeoutAPIs := list "adminClient.GetCrossClusterTasks" "adminClient.GetReplicationMessages"}}
77
{{$longPollTimeoutAPIs := list "frontendClient.ListArchivedWorkflowExecutions" "frontendClient.PollForActivityTask" "frontendClient.PollForDecisionTask" "matchingClient.PollForActivityTask" "matchingClient.PollForDecisionTask"}}
8-
{{$noTimeoutAPIs := list "historyClient.GetReplicationMessages" "historyClient.GetDLQReplicationMessages" "historyClient.CountDLQMessages" "historyClient.ReadDLQMessages" "historyClient.PurgeDLQMessages" "historyClient.MergeDLQMessages" "historyClient.GetCrossClusterTasks" "historyClient.GetFailoverInfo" "matchingClient.GetTaskListsByDomain"}}
8+
{{$noTimeoutAPIs := list "historyClient.GetReplicationMessages" "historyClient.GetDLQReplicationMessages" "historyClient.CountDLQMessages" "historyClient.ReadDLQMessages" "historyClient.PurgeDLQMessages" "historyClient.MergeDLQMessages" "historyClient.GetCrossClusterTasks" "historyClient.GetFailoverInfo" "matchingClient.GetTaskListsByDomain" "sharddistributorClient.WatchNamespaceState"}}
99
{{/*
1010
$fieldMap defines a map of the decorator struct fields
1111
with field name as the key and field type as the value

client/wrappers/timeout/sharddistributor_generated.go

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)