From a212330c7b4b3d1ec958a06227b27689790d98b4 Mon Sep 17 00:00:00 2001 From: hc-github-team-secure-vault-core <82990506+hc-github-team-secure-vault-core@users.noreply.github.com> Date: Mon, 19 Jun 2023 11:40:05 -0400 Subject: [PATCH] backport of commit f12c1285599a1519273bfa68472c598b1fd635bf (#21347) Co-authored-by: Nick Cabatoff --- changelog/21342.txt | 3 +++ command/server.go | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 changelog/21342.txt diff --git a/changelog/21342.txt b/changelog/21342.txt new file mode 100644 index 000000000000..c1d8cd018bb3 --- /dev/null +++ b/changelog/21342.txt @@ -0,0 +1,3 @@ +```release-note:bug +core: Don't exit just because we think there's a potential deadlock. +``` diff --git a/command/server.go b/command/server.go index b1d03eee154b..e3bf7c3c34b9 100644 --- a/command/server.go +++ b/command/server.go @@ -58,6 +58,7 @@ import ( "github.com/mitchellh/go-testing-interface" "github.com/pkg/errors" "github.com/posener/complete" + "github.com/sasha-s/go-deadlock" "go.uber.org/atomic" "golang.org/x/net/http/httpproxy" "google.golang.org/grpc/grpclog" @@ -930,6 +931,9 @@ func (c *ServerCommand) Run(args []string) int { return 1 } + // Don't exit just because we saw a potential deadlock. + deadlock.Opts.OnPotentialDeadlock = func() {} + c.logGate = gatedwriter.NewWriter(os.Stderr) c.logWriter = c.logGate