From 03cb24eec44788b16a4f8a067cd9b0fce87678b5 Mon Sep 17 00:00:00 2001 From: fagongzi Date: Wed, 22 Nov 2023 21:39:38 +0800 Subject: [PATCH] add dump goroutines morpc fatal cherry (#12901) issue [#1826](https://github.com/matrixorigin/MO-Cloud/issues/1826) add dump goroutines morpc fatal cherry --- pkg/common/morpc/backend.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/common/morpc/backend.go b/pkg/common/morpc/backend.go index d1e3d9d8fbba..cb015610e4e1 100644 --- a/pkg/common/morpc/backend.go +++ b/pkg/common/morpc/backend.go @@ -19,6 +19,7 @@ import ( "fmt" "math" "net" + "os" "runtime" "sync" "sync/atomic" @@ -31,6 +32,7 @@ import ( "github.com/matrixorigin/matrixone/pkg/common/stopper" "github.com/matrixorigin/matrixone/pkg/logutil" "github.com/matrixorigin/matrixone/pkg/util/errutil" + "github.com/matrixorigin/matrixone/pkg/util/profile" "go.uber.org/zap" ) @@ -895,6 +897,8 @@ func (rb *remoteBackend) scheduleResetConn() { case rb.resetConnC <- struct{}{}: rb.logger.Debug("schedule reset remote connection") case <-time.After(time.Second * 10): + // dump all goroutines to stderr + profile.ProfileGoroutine(os.Stderr, 2) rb.logger.Fatal("BUG: schedule reset remote connection timeout") } }