问题

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. Linux并发执行很简单,这么干就对了

    嗯,就像标题说的那么简单而已 &的并发功能 time for i in `grep server /etc/hosts | awk '{print $1}'`; do (ssh $i &quo ...

  2. calc() --- css3

    http://www.w3cplus.com/css3/how-to-use-css3-calc-function.html

  3. 什么是PT,PT和BT有什么不同?

    答:PT(Private Tracker)下载其实也是Bt下载的一种,但有两个明显的改进:一是私密的小范围下载,二是进行流量统计,根据上载量决定你的权限. BT下载时,软件会分析.torrent种子文 ...

  4. Python之路,第十三篇:Python入门与基础13

    python3   模块 模块 Module 概念: 模块是一个保护有一系统变量.函数.类等组成的程序组: 模块是一个文件,模块文件名通常以.py 结尾: 作用:让一些相关的变量,函数, 类等有逻辑的 ...

  5. python2.7.9安装mysql-python模块

    我使用的系统版本是: SLES12-sp2 使用python连接Mysql数据库,需要安装mysql-python模块: 1. 首先安装pip: 从python官方网站下载get-pipe.py,执行 ...

  6. Arcgis API for JS——打印控件乱码

    在通过Arcgis API for JS编写打印控件进行地图下载时,总发现地图字体乱码,如下图: 解决方法: 在装有ArcGIS Server,要调用服务的电脑或服务器上找到下图文件夹

  7. java list 的遍历

    import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.I ...

  8. 矩阵快速幂(以HDU1757为例)

    对于数据量大的求余运算,在有递推式的情况下,可以构造矩阵求解. A - A Simple Math Problem Lele now is thinking about a simple functi ...

  9. Ideal部署web工程

  10. import sys

    目录 sys模块的常见函数列表 1.sys.argv 2.sys.platform 3.sys.path 4.sys.exit(n) sys模块提供了一系列有关Python运行环境的变量和函数. 回到 ...