问题

go thrift开发过程中,多个goroutine共用一个client时,报错:

panic: runtime error: index out of range

goroutine 24 [running]:
happy-apple/vendor/git.apache.org/thrift.git/lib/go/thrift.(TCompactProtocol).WriteStructEnd(0xc4201086e0, 0x0, 0x0)
/home/admin/workspace/src/happy-apple/vendor/git.apache.org/thrift.git/lib/go/thrift/compact_protocol.go:160 +0x66
happy-apple/protocol/falconeye.(
TAppleMetric).Write(0xc420112090, 0x787020, 0xc4201086e0, 0x0, 0x0)
/home/admin/workspace/src/happy-apple/protocol/falconeye/common.go:1714 +0xb9
happy-apple/protocol/falconeye.(ReportPutMetricDataArgs).writeField1(0xc4200f85a0, 0x787020, 0xc4201086e0, 0x0, 0x0)
/home/admin/workspace/src/happy-apple/protocol/falconeye/report.go:308 +0x123
happy-apple/protocol/falconeye.(
ReportPutMetricDataArgs).Write(0xc4200f85a0, 0x787020, 0xc4201086e0, 0x200000001, 0x0)
/home/admin/workspace/src/happy-apple/protocol/falconeye/report.go:292 +0x195
happy-apple/protocol/falconeye.(ReportClient).sendPutMetricData(0xc420094320, 0xc4200aa040, 0x1, 0x1, 0x1, 0xc420112090)
/home/admin/workspace/src/happy-apple/protocol/falconeye/report.go:70 +0xe9
happy-apple/protocol/falconeye.(
ReportClient).PutMetricData(0xc420094320, 0xc4200aa040, 0x1, 0x1, 0x1, 0xc4200aa040, 0x0)
/home/admin/workspace/src/happy-apple/protocol/falconeye/report.go:53 +0x4d
main.TestSendData(0xc420094320, 0x0, 0x0)
/home/admin/workspace/src/happy-apple/protocol/falconeye/report-remote/qps_client.go:116 +0x2c9
main.sendTask(0xc420094320)
/home/admin/workspace/src/happy-apple/protocol/falconeye/report-remote/qps_client.go:71 +0x2b
created by main.main
/home/admin/workspace/src/happy-apple/protocol/falconeye/report-remote/qps_client.go:47 +0x17b

使用的lib是git.apache.org/thrift.git/lib/go

原因及解决办法:

一个thrift client 不支持多个协程routine同时使用.
可创建多个client,每个协程routine一个client

go thrift报错问题--WriteStructEnd的更多相关文章

  1. Thrift报错:Error: Thrift compiler: Failed to translate files. Error: Cannot run program thrift error=2

    文章目录 报错: 原因: 解决: 报错: Error: Thrift compiler: Failed to translate files. Error: Cannot run program th ...

  2. jdbc链接hive报错:java.lang.ClassNotFoundException: org.apache.thrift.transport.TTransport

    写了个jdbc连接hive2的demo,结果报错:java.lang.ClassNotFoundException: org.apache.thrift.transport.TTransport,实际 ...

  3. hive12启动报错org.apache.thrift.server.TThreadPoolServer.<init>(Lorg/apache/thrift/server/TThreadPoolServer$Args;)

    执行如下命令启动hive服务:./bin/hive --service hiveserver,报如下错误: Starting Hive Thrift ServerException in thread ...

  4. thrift 版本不一致导致 @Override 报错

    thrift 版本不一致导致 @Override 报错 学习了:http://blog.csdn.net/antony1776/article/details/78920888 版本不一致导致的: 在 ...

  5. bigdata_hiveserver2报错_thrift

    问题一: php客户端,链接hiveserver2 ,报错 如下 1: server.TThreadPoolServer (TThreadPoolServer.java:run(215)) - Err ...

  6. Hive 报错:java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient

    在配置好hive后启动报错信息如下: [walloce@bigdata-study- hive--cdh5.3.6]$ bin/hive Logging initialized using confi ...

  7. [转]happybase1.0 报错:ThriftPy does not support generating module with path in protocol 'f'

    happybase1.0 报错:ThriftPy does not support generating module with path in protocol 'f' 2016-10-12 14: ...

  8. storm报错:Exception in thread "main" java.lang.RuntimeException: InvalidTopologyException(msg:Component: [mybolt] subscribes from non-existent stream: [default] of component [kafka_spout])

    问题描述: storm版本:1.2.2,kafka版本:2.11.   在使用storm去消费kafka中的数据时,发生了如下错误. [root@node01 jars]# /opt/storm-1. ...

  9. Hplsql报错:...HiveSQLExpection:Error while compiling statement:No privilege 'Select' found for inputs {.....}

    实践hplsql时,遇到的问题总结一下,若有不对的地方,欢迎交流. 一.Hplsql简介 hplsql的介绍详见:http://lxw1234.com/archives/2015/09/492.htm ...

随机推荐

  1. UIIimageView读取图片的两种方式及动画的执行

    /**count:图片数量 name:图片名称*/ - (void)runAnimationWithCount:(int)count name:(NSString *)name { if(self.t ...

  2. foreman ubuntu16快速安装

    Quickstart Guide The Foreman installer is a collection of Puppet modules that installs everything re ...

  3. POJ 2234 Matches Game(Nim博弈裸题)

    Description Here is a simple game. In this game, there are several piles of matches and two players. ...

  4. js - 如何使子元素阻止继承父元素事件

    想要阻止点击 #content 区域时触发a事件,需要在 #content 区域内加入阻止事件冒泡的代码,具体代码如下: <div id="box" onclick=&quo ...

  5. Python基础3切片,字符串的方法,for 循环

    切片:截取序列(字符串,列表,元组等)中某一段字符,并不改变原数据和数据类型.结构:[起始位置:终止位置:步长]  但不包括终止位置.所谓:顾头不顾尾. 索引:序列中每个元素都是有编号的,都是从0开始 ...

  6. Power BI新主页将使内容的导航和发现变得轻而易举!

    微软Power BI 将在近日发布Power BI Home登陆页面的公开预览以及Power BI服务中的新全局搜索功能.登录页将成为所有内容的一站式集合,并提供更快捷的方式来分享你的仪表板.原来在左 ...

  7. py解释器PC

    pycharm激活方法: 今天更新了一下pycharm,结果之前的激活就不能用了,下面是激活方法: 1.mac下在终端进入etc目录: cd /etc 2.编辑hosts文件: vi hosts 将“ ...

  8. I.MX6 使用Ubuntu文件系统

    /********************************************************************************* * I.MX6 使用Ubuntu文 ...

  9. 【leetcode】121-Best Time to Buy and Sell Stock

    problem 121. Best Time to Buy and Sell Stock code class Solution { public: int maxProfit(vector<i ...

  10. Java中double转BigDecimal的注意事项

    先上结论:不要直接用double变量作为构造BigDecimal的参数! 线上有这么一段Java代码逻辑: 1,接口传来一个JSON串,里面有个数字:57.3. 2,解析JSON并把这个数字保存在一个 ...