问题

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. git 实现提交远程分支步骤

    git clone git branch [分支名] 创建分支 git branch 查看本地所有分支 git checkout [分支名称] 切换分支 ---写代码--- git status (查 ...

  2. microsoft office如何在菜单里显示“开发工具”

    VBA开发教程: https://www.yiibai.com/vba/vba_excel_macros.html msdn:https://docs.microsoft.com/zh-cn/offi ...

  3. hbuilder注意事项

    App开发注意事项App开发注意事项 单个页面由多个webView组成注意事项. 有两种不同的加载方式. 1.在加载主webView时,初始化Init()时就加载子页面, 此时为异步加载! 2.在主w ...

  4. WPA3在2018年为无线安全添砖加瓦

    Wi-Fi Alliance Announces WPA3, the Successor to Wi-Fi's WPA2 Security Protocol The Wi-Fi Alliance -- ...

  5. react native 之 获取键盘高度

    多说不如多撸: /** * Created by shaotingzhou on 2017/2/23. *//** * Sample React Native App * https://github ...

  6. JS执行机制--事件循环--笔记

    JS的解析是由浏览器中的JS解析引擎完成的.JS是单线程运行,也就是说,在同一个时间内只能做一件事,所有的任务都需要排队,前一个任务结束,后一个任务才能开始.但是又存在某些任务比较耗时,如IO读写等, ...

  7. pytorch使用tensorboardX进行loss可视化

    最近pytorch出了visdom,也没有怎么去研究它,主要是觉得tensorboardX已经够用,而且用起来也十分的简单 pip install tensorboardX 然后在代码里导入 from ...

  8. 并发编程-TPL

    并发编程-TPL 本节导航 基本概念 并发编程 TPL 线程基础 windows为什么要支持线程 线程开销 CPU的发展 使用线程的理由 如何写一个简单Parallel.For循环 数据并行 Para ...

  9. acm 2044

    ////////////////////////////////////////////////////////////////////////////////#include<iostream ...

  10. GinKgoCTF-Crypto

    一:古典密码 一只小羊跳过了栅栏,密码如下: GpKlCeT_FC{rAy_pStiym} 栅栏解密——>11栏 二:滴滴滴 --./-.-/-.-./-/..-./----.--/-../.. ...