Skip to content

Commit

Permalink
ConsumerGroup.Close can infinitely lock
Browse files Browse the repository at this point in the history
  • Loading branch information
maqdev committed Nov 9, 2023
1 parent 01b853a commit d610d0c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions consumer_group.go
Expand Up @@ -213,8 +213,12 @@ 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():
default:
}

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

0 comments on commit d610d0c

Please sign in to comment.