Skip to content

Commit 1df78b4

Browse files
authored
Merge pull request #146573 from yuzefovich/blathers/backport-release-25.2-143990
release-25.2: distsql: cancel remote flows on quiesce
2 parents c015076 + 7a15401 commit 1df78b4

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
@@ -625,6 +625,10 @@ func (ds *ServerImpl) SetupFlow(
625625
// Note: the passed context will be canceled when this RPC completes, so we
626626
// can't associate it with the flow since it outlives the RPC.
627627
ctx = ds.AnnotateCtx(context.Background())
628+
// Ensure that the flow respects the node being shut down. Note that since
629+
// the flow outlives the RPC, we cannot defer the cancel function, so we
630+
// simply ignore it.
631+
ctx, _ = ds.Stopper.WithCancelOnQuiesce(ctx)
628632
if err := func() error {
629633
// Reserve some memory for this remote flow which is a poor man's
630634
// admission control based on the RAM usage.

0 commit comments

Comments
 (0)