Skip to content

Commit

Permalink
stop: grow stacks for async tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
tbg committed Dec 19, 2024
1 parent 3b6f3c6 commit 31c075e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/util/stop/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions pkg/util/stop/stopper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 31c075e

Please sign in to comment.