Skip to content

Commit

Permalink
Merge pull request #393 from travis-ci/meat-sig-switch
Browse files Browse the repository at this point in the history
Switch from SIGWINCH to SIGUSR2 for graceful shutdown + pause
  • Loading branch information
meatballhat authored Oct 16, 2017
2 parents 9464c6c + bd3ce9f commit 44fa026
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ func (i *CLI) signalHandler() {
signal.Notify(signalChan,
syscall.SIGTERM, syscall.SIGINT, syscall.SIGUSR1,
syscall.SIGTTIN, syscall.SIGTTOU,
syscall.SIGWINCH)
syscall.SIGUSR2)

for {
select {
Expand All @@ -508,8 +508,8 @@ func (i *CLI) signalHandler() {
case syscall.SIGTTOU:
i.logger.Info("SIGTTOU received, removing processor from pool")
i.ProcessorPool.Decr()
case syscall.SIGWINCH:
i.logger.Warn("SIGWINCH received, toggling graceful shutdown and pause")
case syscall.SIGUSR2:
i.logger.Warn("SIGUSR2 received, toggling graceful shutdown and pause")
i.ProcessorPool.GracefulShutdown(true)
case syscall.SIGUSR1:
i.logProcessorInfo("received SIGUSR1")
Expand Down

0 comments on commit 44fa026

Please sign in to comment.