1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-27 18:28:30 +00:00
restic/cmd/restic/global_release.go
Michael Pratt e4c469c149 debug: properly handle interrupted profiles
By default (i.e., without profile.NoShutdownHook), profile.Start listens
for SIGINT and will stop the profile and call os.Exit(0).

restic already listens for SIGINT and runs its own cleanup handlers
before calling os.Exit(0).

As is, these handlers are racing when an interrupt occurs, and in my
experience, restic tends to win the race, resulting in an unusable
profile.

Eliminate the race and properly stop profiles on interrupt by disabling
package profile's signal handler and instead stop the profile in a
restic cleanup handler.
2017-08-28 22:03:26 -07:00

6 lines
114 B
Go

// +build !debug
package main
// runDebug is a noop without the debug tag.
func runDebug() error { return nil }