Skip to content

Commit 391aaef

Browse files
authored
Merge pull request #146574 from yuzefovich/blathers/backport-release-25.1-143990
release-25.1: distsql: cancel remote flows on quiesce
2 parents 848b291 + 059915d commit 391aaef

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/sql/distsql/server.go

+4
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,10 @@ func (ds *ServerImpl) SetupFlow(
620620
// Note: the passed context will be canceled when this RPC completes, so we
621621
// can't associate it with the flow since it outlives the RPC.
622622
ctx = ds.AnnotateCtx(context.Background())
623+
// Ensure that the flow respects the node being shut down. Note that since
624+
// the flow outlives the RPC, we cannot defer the cancel function, so we
625+
// simply ignore it.
626+
ctx, _ = ds.Stopper.WithCancelOnQuiesce(ctx)
623627
if err := func() error {
624628
// Reserve some memory for this remote flow which is a poor man's
625629
// admission control based on the RAM usage.

0 commit comments

Comments
 (0)