From 31c075ea29791ef4b1180982071d0f1f5c884943 Mon Sep 17 00:00:00 2001 From: Tobias Grieger Date: Thu, 19 Dec 2024 06:14:17 +0100 Subject: [PATCH] stop: grow stacks for async tasks --- pkg/util/stop/BUILD.bazel | 1 + pkg/util/stop/stopper.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/pkg/util/stop/BUILD.bazel b/pkg/util/stop/BUILD.bazel index 6e471916a2cb..e7fb967bbe2c 100644 --- a/pkg/util/stop/BUILD.bazel +++ b/pkg/util/stop/BUILD.bazel @@ -8,6 +8,7 @@ go_library( deps = [ "//pkg/kv/kvpb", "//pkg/util/debugutil", + "//pkg/util/growstack", "//pkg/util/leaktest", "//pkg/util/log", "//pkg/util/log/logcrash", diff --git a/pkg/util/stop/stopper.go b/pkg/util/stop/stopper.go index 99933c479c37..50dd17e489ca 100644 --- a/pkg/util/stop/stopper.go +++ b/pkg/util/stop/stopper.go @@ -16,6 +16,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/kv/kvpb" "github.com/cockroachdb/cockroach/pkg/util/debugutil" + "github.com/cockroachdb/cockroach/pkg/util/growstack" "github.com/cockroachdb/cockroach/pkg/util/leaktest" "github.com/cockroachdb/cockroach/pkg/util/log" "github.com/cockroachdb/cockroach/pkg/util/log/logcrash" @@ -486,6 +487,7 @@ func (s *Stopper) RunAsyncTaskEx(ctx context.Context, opt TaskOpts, f func(conte // Call f on another goroutine. taskStarted = true // Another goroutine now takes ownership of the alloc, if any. go func(taskName string) { + growstack.Grow() defer s.runPostlude() defer s.startRegion(ctx, taskName).End() defer sp.Finish()