Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Fix PartitionConsumer race condition on Close. #258

Merged
merged 2 commits into from Aug 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion consumer.go
Expand Up @@ -295,7 +295,7 @@ func (c *Consumer) Close() (err error) {
for range c.errors {
}
for p := range c.partitions {
_ = p.Close()
p.AsyncClose()
}
for range c.notifications {
}
Expand Down
2 changes: 1 addition & 1 deletion partitions.go
Expand Up @@ -86,7 +86,7 @@ func (c *partitionConsumer) InitialOffset() int64 { return c.initialOffset }
// AsyncClose implements PartitionConsumer
func (c *partitionConsumer) AsyncClose() {
c.closeOnce.Do(func() {
c.closeErr = c.PartitionConsumer.Close()
c.PartitionConsumer.AsyncClose()
close(c.dying)
})
}
Expand Down