Skip to content

Commit

Permalink
Merge pull request #3555 from PagerDuty/fix-loop-on-sigpipe
Browse files Browse the repository at this point in the history
Do not emit logs on SIGPIPE since logging service could be unavailable
  • Loading branch information
dadgar authored Dec 4, 2017
2 parents dd7b020 + 46493d8 commit f8807ce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions command/agent/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,13 +548,14 @@ WAIT:
case <-c.retryJoinErrCh:
return 1
}
c.Ui.Output(fmt.Sprintf("Caught signal: %v", sig))

// Skip any SIGPIPE signal (See issue #1798)
// Skip any SIGPIPE signal and don't try to log it (See issues #1798, #3554)
if sig == syscall.SIGPIPE {
goto WAIT
}

c.Ui.Output(fmt.Sprintf("Caught signal: %v", sig))

// Check if this is a SIGHUP
if sig == syscall.SIGHUP {
c.handleReload()
Expand Down

0 comments on commit f8807ce

Please sign in to comment.