Skip to content

Commit

Permalink
producer: use ErrClientClosed properly if waiting to produce
Browse files Browse the repository at this point in the history
Previously we would just return the client context, but we may as well
properly promise ErrClientClosed.
  • Loading branch information
twmb committed Jul 8, 2021
1 parent ee918d9 commit 8f1e732
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/kgo/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func (cl *Client) Produce(
select {
case <-p.waitBuffer:
case <-cl.ctx.Done():
drainBuffered(cl.ctx.Err())
drainBuffered(ErrClientClosed)
return
case <-ctx.Done():
drainBuffered(ctx.Err())
Expand Down

0 comments on commit 8f1e732

Please sign in to comment.