panic: interface conversion: interface {} is nil, not chan *sarama.ProducerError
来源:互联网 发布:阿里云服务器类型 编辑:程序博客网 时间:2024/06/06 01:15
使用golang kafka sarama 包时,遇到如下问题:
高并发情况下使用同步sync producer,偶尔遇到crash:
panic: interface conversion: interface {} is nil, not chan *sarama.ProducerError
goroutine 413 [running]:
github.com/Shopify/sarama.(*syncProducer).handleSuccesses(0xc420384840)
/home/lanyang/github.com/Shopify/sarama/sync_producer.go:147 +0x139
github.com/Shopify/sarama.handleSuccesses)-fm()
/home/lanyang/src/github.com/Shopify/sarama/sync_producer.go:76 +0x2f
github.com/Shopify/sarama.withRecover(0xc4201d0750)
/home/lanyang/src/github.com/Shopify/sarama/utils.go:43 +0x45
created by github.com/Shopify/sarama.newSyncProducerFromAsyncProducer
/home/lanyang/src/github.com/Shopify/sarama/sync_producer.go:76 +0x112
问题不容易复现,github上已经留言:
https://github.com/Shopify/sarama/issues/785
download
https://github.com/Shopify/sarama
https://shopify.github.io/sarama/
doc
https://godoc.org/github.com/Shopify/sarama
依赖
github.com/davecgh/go-spew
github.com/eapache/go-resiliency
github.com/eapache/go-xerial-snappy
github.com/eapache/queuegithub.com/pierrec/lz4
github.com/pierrec/xxHashgithub.com/rcrowley/go-metrics
github.com/golang/snappy
如果kafka down掉,又恢复,client 可自动连接上。
异步方式,网络断开后,仍然会从queue,放入producer的channel中,重连后,这些内容丢失。
例子参考
sync
http://legendtkl.com/2016/06/30/kafka-in-action/
https://studygolang.com/articles/7102
async
https://studygolang.com/articles/11199
- panic: interface conversion: interface {} is nil, not chan *sarama.ProducerError
- go:*handler is pointer to interface, not interface
- xtion usb interface is not supported
- golang: 详解interface和nil
- golang: 详解interface和nil
- golang: 详解interface和nil
- golang: 详解interface和nil
- An interface is not a pointer to an object. It's an interface.
- Interface
- interface
- interface
- interface
- interface
- interface
- @interface
- Interface
- @interface
- Interface
- 深入理解java对象的创建过程:类的初始化和实例化
- php时间函数
- 发送post请求下载文件
- solidworks 2016 crack
- 生成元
- panic: interface conversion: interface {} is nil, not chan *sarama.ProducerError
- win10 ubuntu16 双系统,无法grb引导的解决
- lower_bound和upper_bound算法
- Java中outer标签的用法
- Linux—给普通用户sudo权限
- 第三课 Netty客户端
- Codeforces 877D. Olya and Energy Drinks BFS+并查集
- 2017-10-29 DBA日记,dbms_stats打开并行度后引发递归登录次数过高
- Gradle详解(一)——Groovy语法快速入门