wvanbergen/kafka

Run into "index out of range" when launch multiple concurrent consumers "go routine" in a single go process

mrcold opened this issue · 1 comments

Is this supported, multiple consumers of a same consumer group run concurrently in a single go process? I run into following err, any ideas? Thanks!

panic: runtime error: index out of range

goroutine 4395258 [running]:
panic(0x7e1ec0, 0xc820010090)
/usr/local/go/src/runtime/panic.go:464 +0x3e6
github.com/wvanbergen/kazoo-go.(_ConsumergroupInstanceList).Less(0xc8df7bc480, 0x3, 0xffffffffffffffff, 0x1)
:10 +0x124
sort.doPivot(0x7fa8cba22338, 0xc8df7bc480, 0x3, 0x18, 0x9, 0x3)
/usr/local/go/src/sort/sort.go:128 +0x27b
sort.quickSort(0x7fa8cba22338, 0xc8df7bc480, 0x3, 0x18, 0x8)
/usr/local/go/src/sort/sort.go:195 +0xa3
sort.Sort(0x7fa8cba22338, 0xc8df7bc480)
/usr/local/go/src/sort/sort.go:229 +0x74
github.com/wvanbergen/kafka/consumergroup.dividePartitionsBetweenConsumers(0xc8f8824540, 0x18, 0x18, 0xc8bac5fc00, 0x3c, 0x3c, 0x0)
/Users/lhan/Dev/gopath/src/github.com/wvanbergen/kafka/consumergroup/utils.go:40 +0x192
github.com/wvanbergen/kafka/consumergroup.(_ConsumerGroup).topicConsumer(0xc82479a090, 0x887910, 0xb, 0xc82649d080, 0xc82649d0e0, 0xc86102b740)
/Users/lhan/Dev/gopath/src/github.com/wvanbergen/kafka/consumergroup/consumer_group.go:333 +0x850
created by github.com/wvanbergen/kafka/consumergroup.(*ConsumerGroup).topicListConsumer
/Users/lhan/Dev/gopath/src/github.com/wvanbergen/kafka/consumergroup/consumer_group.go:271 +0x40a

No, you'll need a separate process for every consumer instance.