backport of commit 7872338ec1 (#23638)

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
This commit is contained in:
hc-github-team-secure-vault-core
2023-10-16 16:43:05 -04:00
committed by GitHub
parent 85014f9869
commit 3f9537ede0
2 changed files with 5 additions and 0 deletions

3
changelog/23636.txt Normal file
View File

@@ -0,0 +1,3 @@
```release-note:bug
command/server: Fix bug with sigusr2 where pprof files were not closed correctly
```

View File

@@ -1751,8 +1751,10 @@ func (c *ServerCommand) Run(args []string) int {
err = pprof.Lookup(dump).WriteTo(pFile, 0)
if err != nil {
c.logger.Error("error generating pprof data", "name", dump, "error", err)
pFile.Close()
break
}
pFile.Close()
}
c.logger.Info(fmt.Sprintf("Wrote pprof files to: %s", dir))