Skip to content

Commit

Permalink
backport of commit 7872338
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonodonnell authored Oct 12, 2023
1 parent b97ad27 commit 5a22639
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog/23636.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
command/server: Fix bug with sigusr2 where pprof files were not closed correctly
```
2 changes: 2 additions & 0 deletions command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1847,8 +1847,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))
Expand Down

0 comments on commit 5a22639

Please sign in to comment.