From f45e82753547bc85786d907274571f1f50830572 Mon Sep 17 00:00:00 2001 From: Matt Reiferson Date: Sat, 22 Nov 2014 10:07:37 -0800 Subject: [PATCH] nsqd: don't try to stop handlers if we time out exiting --- consumer.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/consumer.go b/consumer.go index 0173a8ec..93b43bee 100644 --- a/consumer.go +++ b/consumer.go @@ -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() }) } }