Skip to content

Commit

Permalink
nsqd: don't try to stop handlers if we time out exiting
Browse files Browse the repository at this point in the history
  • Loading branch information
mreiferson committed Nov 22, 2014
1 parent 7eb4205 commit f45e827
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,12 @@ func (r *Consumer) Stop() {
}

time.AfterFunc(time.Second*30, func() {
r.stopHandlers()
// if we've waited this long handlers are blocked on processing messages
// so we can't just stopHandlers (if any adtl. messages were pending processing
// we would cause a panic on channel close)
//
// instead, we just bypass handler closing and skip to the final exit
r.exit()
})
}
}
Expand Down

0 comments on commit f45e827

Please sign in to comment.