Skip to content

Commit

Permalink
Merge pull request #4918 from liusdu/sig_bus
Browse files Browse the repository at this point in the history
signal: do not print message when dealing with SIG_PIPE
  • Loading branch information
crosbymichael committed Jan 12, 2021
2 parents 38604a7 + 8627739 commit abc0041
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/containerd/command/main_unix.go
Expand Up @@ -45,12 +45,17 @@ func handleSignals(ctx context.Context, signals chan os.Signal, serverC chan *se
case s := <-serverC:
server = s
case s := <-signals:

// Do not print message when deailing with SIGPIPE, which may cause
// nested signals and consume lots of cpu bandwidth.
if s == unix.SIGPIPE {
continue
}

log.G(ctx).WithField("signal", s).Debug("received signal")
switch s {
case unix.SIGUSR1:
dumpStacks(true)
case unix.SIGPIPE:
continue
default:
if err := notifyStopping(ctx); err != nil {
log.G(ctx).WithError(err).Error("notify stopping failed")
Expand Down

0 comments on commit abc0041

Please sign in to comment.