Skip to content

Commit

Permalink
ConsumerGroup.Close can infinitely lock
Browse files Browse the repository at this point in the history
Signed-off-by: Magomed Abdurakhmanov <maqdev@gmail.com>
  • Loading branch information
maqdev committed Nov 14, 2023
1 parent 03f6aab commit a7e536a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions consumer_group.go
Expand Up @@ -213,8 +213,11 @@ func (c *consumerGroup) Consume(ctx context.Context, topics []string, handler Co
return err
}

// Wait for session exit signal
<-sess.ctx.Done()
// Wait for session exit signal or Close() call
select {
case <-c.closed:
case <-sess.ctx.Done():
}

// Gracefully release session claims
return sess.release(true)
Expand Down

0 comments on commit a7e536a

Please sign in to comment.