diff --git a/nsqd/protocol_v2.go b/nsqd/protocol_v2.go index 54cd526a9..7e060e355 100644 --- a/nsqd/protocol_v2.go +++ b/nsqd/protocol_v2.go @@ -615,6 +615,10 @@ func (p *protocolV2) SUB(client *clientV2, params [][]byte) ([]byte, error) { for { topic := p.ctx.nsqd.GetTopic(topicName) channel = topic.GetChannel(channelName) + if channel.Exiting() || topic.Exiting() { + time.Sleep(1 * time.Millisecond) + continue + } if err := channel.AddClient(client.ID, client); err != nil { return nil, protocol.NewFatalClientErr(nil, "E_TOO_MANY_CHANNEL_CONSUMERS", fmt.Sprintf("channel consumers for %s:%s exceeds limit of %d",