Skip to content

Commit 81ebd2a

Browse files
authored
Merge pull request #161176 from kyle-a-wong/backport26.1-160403
release-26.1: persistedsqlstats: add WithCancelOnQuiesce to MaybeFlushWithDrainer
2 parents d25d1d9 + 9f6db4d commit 81ebd2a

File tree

1 file changed

+2
-0
lines changed
  • pkg/sql/sqlstats/persistedsqlstats

1 file changed

+2
-0
lines changed

pkg/sql/sqlstats/persistedsqlstats/flush.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ func (s *PersistedSQLStats) MaybeFlush(ctx context.Context, stopper *stop.Stoppe
5555
func (s *PersistedSQLStats) MaybeFlushWithDrainer(
5656
ctx context.Context, stopper *stop.Stopper, ssDrainer sqlstats.SSDrainer,
5757
) bool {
58+
ctx, stopCancel := stopper.WithCancelOnQuiesce(ctx)
59+
defer stopCancel()
5860
now := s.getTimeNow()
5961
allowDiscardWhenDisabled := DiscardInMemoryStatsWhenFlushDisabled.Get(&s.cfg.Settings.SV)
6062
minimumFlushInterval := MinimumInterval.Get(&s.cfg.Settings.SV)

0 commit comments

Comments
 (0)