|
|
@@ -208,9 +208,16 @@ func (p *Producer) Input() chan<- *MessageToSend {
|
|
|
// it may otherwise leak memory. You must call this before calling Close on the
|
|
|
// underlying client.
|
|
|
func (p *Producer) Close() error {
|
|
|
- go func() {
|
|
|
+ go withRecover(func() {
|
|
|
p.input <- &MessageToSend{flags: shutdown}
|
|
|
- }()
|
|
|
+ })
|
|
|
+
|
|
|
+ if p.config.AckSuccesses {
|
|
|
+ go withRecover(func() {
|
|
|
+ for _ = range p.successes {
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
var errors ProduceErrors
|
|
|
for event := range p.errors {
|