Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions signals/signals.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ func Handle() chan struct{} {
return HandleWithInterrupt(nil)
}

// HandleWithInterrupt starts a goroutine which listens for SIGTERM, SIGINT, and
// SIGKILL and explicitly ignores SIGPIPE. It calls the finalizer function when
// HandleWithInterrupt starts a goroutine which listens for SIGTERM and SIGINT, and
// explicitly ignores SIGPIPE. It calls the finalizer function when
// the first signal is received and forcibly terminates the program after the
// second. If a nil function is provided, the program will exit after the first
// signal.
Expand All @@ -37,9 +37,9 @@ func handleSignals(finalizer func(), finishedChan chan struct{}) {
noopChan := make(chan os.Signal)
signal.Notify(noopChan, syscall.SIGPIPE)

log.Logv(log.DebugLow, "will listen for SIGTERM, SIGINT, and SIGKILL")
log.Logv(log.DebugLow, "will listen for SIGTERM and SIGINT")
sigChan := make(chan os.Signal, 2)
signal.Notify(sigChan, syscall.SIGTERM, syscall.SIGINT, syscall.SIGKILL)
signal.Notify(sigChan, syscall.SIGTERM, syscall.SIGINT)
defer signal.Stop(sigChan)
if finalizer != nil {
select {
Expand Down