diff --git a/consumer.go b/consumer.go index b77b6a4f..5fafe8f6 100644 --- a/consumer.go +++ b/consumer.go @@ -982,7 +982,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() }) } }