zipkin filter 不支持采样率、不支持 kafka 方式上报、不支持多个 servant
zipkin filter 不支持采样率,默认使用了 AlwaysSample 上报只支持 http 方式 当多个 servant 共存时,trace 上报无法区分是哪个 servant,也未上报端口
go.mod的go版本是1.13实际上用了go1.16才有的函数
代码行tars/tools/tarsgo/internal/base/templates.go:274
os.WriteFile 这个函数到go 1.16才支持
看到了,
新版的tars2go不支持相对路径
Move docs to TarsCloud/TarsDocs
日志记录支持json格式
Go mod tidy failed
new version creater has issue
新版本接口返回void生成代码存在语法错误
Upgrade all examples to go mod
有个服务跑着跑着就挂了,日志也没记录原因
编译报错
日志输出大小限制失效
怎么自定义负载均衡
文件句柄泄漏
tars-go与client交互协议
tars2go不支持include参数 和 单文件定义多个模块
tars transport readtimeout not work
如何使用TarsGo获取平台服务配置下配置列表里的配置
gtime data race
可否支持HTTP/2
嵌套 MsgOutGameShowF3 byte [3] 这样生成go 文件有错
struct MsgOutGameShowF3{ 1 require byte count[3]; }; struct MsgOutGameShowF64{ 1 require byte count[64]; }; struct MsgOutGameShowF20{ 1 require byte count[20]; }; struct DMsgOutGameShow{ 10 require MsgOutGameShowF3 fff[5]; 12 require MsgOutGameShowF64 ffgf[5]; };
是需要定义数组吗?可以用vector
另外一个端使用的c++, 用vector 有点问题
是定义的二维数组
二维数组可以这样用,如果C++侧使用有问题,可能在tarscpp项目提下issue
1 require vector<vector
handletimeout ineffective!!!
Describe the bug handletimeout ineffectived, when the actual execution time exceeds the handletime but does not exceed the remote call timeout To Reproduce 1、set handletimeout 1500
2、sleep 2 seconds
simulate execution time with sleep func
** Version info **
go version go1.16.6 darwin/amd64
TarsGo v1.1.6
Expected behavior get server invoke timeout error and cost close to handletimeout Actual behavior get unexcepet err and cost close to async-invoke-timeout
Wrong index in endpoint manager
endpointmanager.go
sort.Slice(sortedEps, func(i int, j int) bool { – return crc32.ChecksumIEEE([]byte(sortedEps[i].Key)) < crc32.ChecksumIEEE([]byte(sortedEps[i].Key)) ++ return crc32.ChecksumIEEE([]byte(sortedEps[i].Key)) < crc32.ChecksumIEEE([]byte(sortedEps[j].Key)) })
Would you like to submit a fix?
#293
go 1.16版本 $GOPATH下并没有src目录,故而无视使用 tools 下的生成服务模版的脚本
请问无有优雅的方法继续按文档方式使用tools下的脚本新建服务模版和使用cmake打包
默认的服务模板应该要升级到go mod了,然后不用关心GOPATH的问题。 @aiyogg 是否有意愿提个PR?
默认的服务模板应该要升级到go mod了,然后不用关心GOPATH的问题。 @aiyogg 是否有意愿提个PR?
我理解的是需要用go翻译下那几个shell脚本,将初始化服务模板能单独作为 module 来install? 工作节奏缓和下来了我可以试试
默认的服务模板应该要升级到go mod了,然后不用关心GOPATH的问题。 @aiyogg 是否有意愿提个PR?
我理解的是需要用go翻译下那几个shell脚本,将初始化服务模板能单独作为 module 来install? 工作节奏缓和下来了我可以试试
是的,欢迎提PR.
@aiyogg 这里有进展吗?
@aiyogg 这里有进展吗?
目前没有进展-_-!
先关闭,有必要再重新打开
“github.com/openzipkin-contrib/zipkin-go-opentracing” v0.3.5 版本报错
tars/plugin/zipkintracing/zipkintracing.go 43行 建议升级到v0.4.5
This could be closed once #275 get merged.
TKS
zipkin-go-opentracing 需升级到v0.4.5,go.mod里面需要改了
Fixed in #320
tars2go声明map后没有make导致的问题
genSwitchCase中的map只有声明没有make,导致后面使用map时报assignment to entry in nil map错误 已经提了pr: #286
tarsgo rpc server 配置参数maxroutine 无法按照servant级别配置
tarsgo rpc server 有个maxroutine 这个配置目前是针对server级别进行的,无法针对每个servant进行单独配置
绝大部分场景下一个服务一个servant就够了,这里的单独配置是否有必要性?
Support access log
希望能配置可打印请求的入参与出参
服务优雅退出时没有先关闭注册中心心跳
TarsGo/tars/application.go
Line 439
in
4ba2325
teerDown(nil)
graceShutdown函数在进程退出时,将listen端口关闭,然后处理退出信号前的请求,最后才去停止心跳。导致服务升级时,如果请求量过大时,在优雅退出的一段时间内,注册中心仍然认为该退出进程存活。会使得其他服务进程继续请求正在退出的进程然后返回超时错误。 是否将teerDown停止keepalive心跳函数放在listen端口关闭之后会比较合理,这样在注册中心就不会认为这个进程还存活。
新的请求应该会到新的进程
新的请求应该会到新的进程
注册中心认为它是存活的,新请求应该还是会到这个要退出的进程吧。 因为现在我们在进行服务升级的时候发现会出现超时请求服务。排查问题应该是这里导致的,退出进程实际没有提供服务,但是客户端和注册中心认为他是存活的,所以继续发送请求然后请求超时。
是什么协议的服务?优雅退出时间是多少?
是什么协议的服务?优雅退出时间是多少?
使用的是pb协议,优雅退出时间是默认的60000ms
graceShutdown主要是解决服务优雅重启的问题,优雅退出应该要另外方案,@MeiJunh 这里是否相关想法或方案?
如无相关回复就先关闭,有需要可以重新打开
支持基于请求参数的版本路由
每个节点都打上版本标识和路由规则,利用Context中的字段进行路由 比如 版本v1的规则是{“k1”: {“prefix”: “abc”}},则只有Context中有k1字段,且前缀是abc时才会路由到v1版本。
Relative issue:TarsCloud/Tars#846.
fd leak on server side when close connection
We experienced a problem due to fd leak on server side. Here is the detail:
When client send requests with packet size greater than MaxPackageLength which result in a PACKAGE_ERROR on server side Server close the connection by calling (net.TCPConn).Close() But the connection is NOT closed since we make a copy of the underlying fd in (transport.tcpHandler).Handle All subsequent requests from the client on the same connection failed with timeout error
This could result in:
run out of fd on server side DoS if the client is also a Tars server which is the situation we faced
fixed by #274
接口处理groutine panic进程直接退出
发现接口函数没有开启新groutine,panic后也会导致整个进程的panic。 查看框架内部实际上在invoke的时候是有调用CheckPanic的,
TarsGo/tars/tarsprotocol.go
Line 36
in
26a06ec
defer CheckPanic()
但是这个CheckPanic函数会直接exit,没有达到recover的效果,和请求分发在同一个groutine的panic是否也需要业务方自己recover,例如在filter中进行recover
TarsGo/tars/panic.go
Line 21
in
26a06ec
rogger.FlushLogger()
这2行可以去掉,考虑可能出现大量panic,可以在生成panic文件加个频控。 @MeiJunh 方便提个MR?
TarsGo/tars/panic.go
Line 21
in
26a06ec
rogger.FlushLogger()
这2行可以去掉,考虑可能出现大量panic,可以在生成panic文件加个频控。 @MeiJunh 方便提个MR?
这个频控监测是加到内存里么?感觉仅仅是监测日志记录其实不太能及时的获取到panic信息,进程直接down掉对业务影响又比较大,目前我们这边在使用的时候是遇到panic后进行告警信息通知发送。 看是直接去掉 rogger.FlushLogger() os.Exit(-1) 这两行提一个mr,还是需要加上以函数文件为指标的panic频率监控再提一个mr?
TarsGo/tars/panic.go
Line 21
in
26a06ec
rogger.FlushLogger()
这2行可以去掉,考虑可能出现大量panic,可以在生成panic文件加个频控。 @MeiJunh 方便提个MR?
这个频控监测是加到内存里么?感觉仅仅是监测日志记录其实不太能及时的获取到panic信息,进程直接down掉对业务影响又比较大,目前我们这边在使用的时候是遇到panic后进行告警信息通知发送。 看是直接去掉 rogger.FlushLogger() os.Exit(-1) 这两行提一个mr,还是需要加上以函数文件为指标的panic频率监控再提一个mr?
加一个OnPanic的回调感觉比较合理,默认回调是把panic信息打到本地文件,频控可以用golang.org/x/time/rate,没有频控可以评估下,可能问题也不大。
TarsGo/tars/panic.go
Line 21
in
26a06ec
rogger.FlushLogger()
这2行可以去掉,考虑可能出现大量panic,可以在生成panic文件加个频控。 @MeiJunh 方便提个MR?
这个频控监测是加到内存里么?感觉仅仅是监测日志记录其实不太能及时的获取到panic信息,进程直接down掉对业务影响又比较大,目前我们这边在使用的时候是遇到panic后进行告警信息通知发送。 看是直接去掉 rogger.FlushLogger() os.Exit(-1) 这两行提一个mr,还是需要加上以函数文件为指标的panic频率监控再提一个mr?
加一个OnPanic的回调感觉比较合理,默认回调是把panic信息打到本地文件,频控可以用golang.org/x/time/rate,没有频控可以评估下,可能问题也不大。
回调函数可以直接加上去,针对panic所在文件的频控添当达到频控次数后是进行日志刷盘以及os.exit么? 另外我尝试了一下好像没有推送代码的权限。
TarsGo/tars/panic.go
Line 21
in
26a06ec
rogger.FlushLogger()
这2行可以去掉,考虑可能出现大量panic,可以在生成panic文件加个频控。 @MeiJunh 方便提个MR?
这个频控监测是加到内存里么?感觉仅仅是监测日志记录其实不太能及时的获取到panic信息,进程直接down掉对业务影响又比较大,目前我们这边在使用的时候是遇到panic后进行告警信息通知发送。 看是直接去掉 rogger.FlushLogger() os.Exit(-1) 这两行提一个mr,还是需要加上以函数文件为指标的panic频率监控再提一个mr?
加一个OnPanic的回调感觉比较合理,默认回调是把panic信息打到本地文件,频控可以用golang.org/x/time/rate,没有频控可以评估下,可能问题也不大。
回调函数可以直接加上去,针对panic所在文件的频控添当达到频控次数后是进行日志刷盘以及os.exit么? 另外我尝试了一下好像没有推送代码的权限。
应该是说 PR Fork 后修改,然后创建一个 PR 即可
TarsGo/tars/panic.go
Line 21
in
26a06ec
rogger.FlushLogger()
这2行可以去掉,考虑可能出现大量panic,可以在生成panic文件加个频控。 @MeiJunh 方便提个MR?
这个频控监测是加到内存里么?感觉仅仅是监测日志记录其实不太能及时的获取到panic信息,进程直接down掉对业务影响又比较大,目前我们这边在使用的时候是遇到panic后进行告警信息通知发送。 看是直接去掉 rogger.FlushLogger() os.Exit(-1) 这两行提一个mr,还是需要加上以函数文件为指标的panic频率监控再提一个mr?
加一个OnPanic的回调感觉比较合理,默认回调是把panic信息打到本地文件,频控可以用golang.org/x/time/rate,没有频控可以评估下,可能问题也不大。
回调函数可以直接加上去,针对panic所在文件的频控添当达到频控次数后是进行日志刷盘以及os.exit么? 另外我尝试了一下好像没有推送代码的权限。
应该是说 PR Fork 后修改,然后创建一个 PR 即可
谢谢,已经提了pr,https://github.com/TarsCloud/TarsGo/pull/278,看是否满足要求,只加了一个onPanic回调函数,没有对panic进行频控。
在json反序列化时,int64会出现精度丢失的问题
TarsGo/tars/tools/tars2go/gen_go.go
Lines 1467 to 1468
in
7301d63
具体问题和解决办法参考:https://zhuanlan.zhihu.com/p/114286134 建议修复一下
提个建议,install_tarsnode.sh 这个脚本加个可以配置安装路径参数
线上环境一般没有/usr/local 权限, 建议tarsnode安装可以配置安装路径
可以转到https://github.com/TarsCloud/TarsFramework提个issue。
Support for registering multiple client and server filter
As far as I know, TarsGo supports registering client filter with tars.RegisterClientFilter() method. And if you have multiple client filter, you may have to use tars.RegisterPreClientFilter and tars.RegisterPostClientFilter. However, I don’t want to split any of them to one pre filter and one post filter when I register multiple client filters. For example, I register client breaker filter and client zipkin filter, they may both have pre handle logic and post handle logic. In the current way, I can only register one client filter. And another client filter has to be split to one pre filter and one client filter. I think it’s a good idea that TarsGo supports muliple filter with using middlewares.
Support error code for RPC error
建议在rpc返回的error中提供错误码的支持: 在服务端的实现类返回的error可以是tars.Error{Code: 222, Message: “error msg”} 在客户端自动将有错误码的报错err转成tars.Error类型 客户端的调用方可以通过codedErr, ok := err.(tars.Error)来获取类型及错误码
unknown plugin “tarsrpc”
我按照pb2tarsgo的教程使用时,报下面的错误,请问怎么处理? [root@localhost proto]# protoc –go_out=plugins=tarsrpc:. helloworld.proto WARNING: Package “github.com/golang/protobuf/protoc-gen-go/generator” is deprecated. A future release of golang/protobuf will delete this package, which has long been excluded from the compatibility promise. 2020/11/24 21:38:40 WARNING: Missing ‘go_package’ option in “helloworld.proto”, please specify it with the full Go package path as a future release of protoc-gen-go will require this be specified. See https://developers.google.com/protocol-buffers/docs/reference/go-generated#package for more information. –go_out: protoc-gen-go: unknown plugin “tarsrpc”
use github.com/golang/protobuf v1.3.5
use yaml or toml for conf file
this is the current conf file, which I think very hard to read
Proposed config file server: TestApp.HelloServer.HelloObjAdapter: allow: true ….
This configuration format is consistent with other language service frameworks, so it is not easy to change to yaml
unfortunately, these xml attributes are so hard to read
希望可以把 pb2tarsgo 独立出来
直接 go get 生成到 bin 目录 当然,更好的 tars2go 可以命令行直接生成项目,不要用 shell 文件初生成,现在都是 go mod 模式,去到 mod 找文件夹很麻烦
go get github.com/go-tars/protoc-gen-tars@master
protoc –go_out=. –tars_out=. example.proto
go vet complain about code generated by tars2go
Code generated by tars2go tool contains the following line: err = fmt.Errorf(“Decode reqpacket fail, error version:”, tarsReq.IVersion) When run against go vet, it complains: Errorf call has arguments but no formatting directives
support request timeout for single api
As far as I know, tars only support timeout for a client , meanwhile all the request sent with this client use the same timeout. As we know, different api timeout requirement is remarkable, please support this feature, or could any good gay tell me how to alternative solution?
Solution: current.SetClientTimeout(ctx, timeout)
High concurrency response occasional timeout
压测时,偶现 服务端 回包超时的情况。 晚点提个pr
Tars2go support outdir in parent directory when using go mod
tarsgo –outdir=../autogen –module=github.com/defool/proj/s1 Server.tars The generated code can not be complied because the import path is github.com/defool/proj/s1/../autogen/xxx. The expected import path should be github.com/defool/proj/autogen/xxx.
Command line tool using tarsgo prints error the server config path empty
I don’t think it’s necessary to print the error message the server config path empty.
Support prometheus exporter
Tars支持使用Prometheus监控 描述 当前Tars有merics监控上报,但是缺少Tp95/Tp99耗时、波动告警等能力,希望能引入云原生Prometheus监控组件提升Tars服务的监控能力。 目标
Tars服务端/客户端都引入Prometheus SDK 提供数据上报到prometheus的解决方案 在grafana配置监控面板,可显示调用总量、失败量、tp95耗时、tp99耗时。筛选条件包含主调服务、被调服务。
方案(仅供参考)
基于Tars的filter机制,实现client filter,将rpc调用数据使用Prometheus sdk记录 Prometheus对接k8s名字服务,通过label方式筛选,自动收集部署在k8s中的tars服务监控数据
需要技能及相关引用
Prometheus对接k8s Tars filter Grafana
什么玩意儿啊,文档能不能搞好点啊
No description provided.
【timeout】timeout for very low latency tars request.
Seems it’s a concurrent issue with sending/receiving channel. try this code below: func Test_TarsSelect(t *testing.T) { trueCount := 0 falseCount := 0 for i := 0; i < 10000; i++ { if TarsThread() { trueCount++ } else { falseCount++ } }
fmt.Println("trueCount:", trueCount)
fmt.Println("falseCount:", falseCount) }
func TarsThread() bool { someChan := make(chan bool) var gotChan bool
go Send(someChan)
select {
case <-time.After(1 * time.Millisecond):
case gotChan = <-someChan:
}
return gotChan }
func Send(someChan chan bool){ select { case someChan <- true: default: } } the outputs will be something like: trueCount: 9902 falseCount: 98
try to fix this issue: #240
函数返回值和错误信息只能二选一?
` func (imp *HelloImp) Test() (int32, error) { //这样客户端可以获得 返回值 -1 和 nil return -1, nil } func (imp *HelloImp) Test() (int32, error) { //这样客户端只能获得 返回值 0 和 “test error” return -1, errors.New(“test error”) } ` 当服务端函数返回值 error存在时,第一个返回值信息就不会返回! 这个问题怎么解?
刚刚测试了,没有任何问题。和框架没关系,可能是你的go代码写的有问题。。断点调试下
刚刚测试了,没有任何问题。和框架没关系,可能是你的go代码写的有问题。。断点调试下
我的环境是:TarsFramework >= v2.4.4, TarsGo >= v1.1.4 协议: int Test(int x); 实现代码: func (imp *EthereumWalletImp) Test(ctx context.Context, t int32) (int32, error) { //Doing something in your function //… if t > 10 { return t, errors.New(“What?”) } return t, nil } 通过后台提供的在线接口调试: 参数为: -13 结果: {“consttime”:0.7267720103263855,”arguments”:{},”return”:-13} 参数为: 20 结果: {“costtime”:2.1954140663146973,”error”:{“code”:1,”message”:”What?”}} 确实是 存在 error时,另外一个参数不返回 不管是我客户端代码 还是 官方的后台 接口调试 返回都是这样
该issue长期未更新。如果问题依旧没解决,欢迎重新打开issue。TARS社区有您更精彩。 Thanks for your supporting. The issue has not been updated for a long time. If the problem is still not resolved, welcome to reopen the issue.
刚刚测试了,没有任何问题。和框架没关系,可能是你的go代码写的有问题。。断点调试下
这个应该是自动生成代码中的逻辑。 我新建了一个pb,然后构建,其中自动生成的Dispatch函数中会在function返回err时直接返回err而没有将rsp塞回至output。可能是使用方式不一样导致会有一些误解。 如下图,当函数返回err则dispatch直接返回了
pb2tarsgo 问题正确无法生成
环境 ubuntu 12.04, protocol 3.6.1 , 根据教程配置出来的protoc-gen-go –go_out: protoc-gen-go: Plugin output is unparseable: 我在mac环境配过一下,可以生成 ,但生成 pb.go 并没有rpc相关的service代码。 发现插件没有走tarsrpc里的Generate方法。能否查证一下
Poor performance of ReportStat
var sendQps = rate.NewLimiter(5000, 100) func report() { msg := &tars.Message{ Req: &requestf.RequestPacket{ SFuncName: “Sum”, SServantName: “App.DefooT2”, }, } for i := 0; i < 100000; i++ { sendQps.Wait(context.Background()) startTime := time.Now().UnixNano() tars.ReportStat(msg, 1, 0, 0) ttt := time.Now().UnixNano() - startTime useTime <- ttt } }
var useTime = make(chan int64, 1000) func showUseTime() { tk := time.NewTicker(time.Second) count := 0 totalTime := 0 maxTime := 0 for { select { case <-tk.C: if count > 0 { fmt.Printf(“%v count: %d, mean time: %d ms, max %d ms\n”, time.Now().Format(time.RFC3339), count, totalTime/count, maxTime) count = 0 totalTime = 0 maxTime = 0 } case ts := <-useTime: ms := int(ts / int64(time.Millisecond)) if ms > maxTime { maxTime = ms } count++ totalTime += ms } } }
This demo shows that tars.ReportStat costs tens ms every 10 seconds.
Support Https for servant
Now, TasGo only support Http servant, TarsGo should support Https servant.
Supported this in #319
TarsGo客户端不会自动上报stat和property
TarsGo客户端,如果不是部署在Tars框架内的话,不会自动上报state和property。而TarsJava即使不部署在Tars框架内,也会正常自动上报,这个特性还是很好用的,用到的场景也比较多,因为很多情况下,服务是不会部署在Tars框架内的。 使用的是当前最新的TarsGo release版本1.1.4,不知道有没有计划解决这一问题。
确实有必要实现,是否有愿意提供方案或直接提PR?
确实有必要实现,是否有愿意提供方案或直接提PR?
我准备提pr,怎么成功 contributors
看了提交的方案,感觉对原application.go做了比较多侵入性的改造,会原有功能稳定性有潜在的影响,建议调整一下: 最终只需要调整statf.go和property.go即可,以statf为例,可以增加一个类似StatConfig的结构体,将依赖的clientconfig/serverconfig字段放到里面,另外加一个类似InitForClientMode函数入口,传入上报功能依赖的Communitor和StatConfig。
看了提交的方案,感觉对原application.go做了比较多侵入性的改造,会原有功能稳定性有潜在的影响,建议调整一下: 最终只需要调整statf.go和property.go即可,以statf为例,可以增加一个类似StatConfig的结构体,将依赖的clientconfig/serverconfig字段放到里面,另外加一个类似InitForClientMode函数入口,传入上报功能依赖的Communitor和StatConfig。
对标了java的实现,让使用起来更透明化
v1.1.8 开始支持自动上报
请问有没有方便的上传tgz包的工具啊
开发阶段,随便改点东西,打包,点上传,点发布,这个步骤很多,浪费时间啊。 没有工具能在客户端直接把tgz包post到web管理端吗?
可以在本地启动开发调试啊
可以使用TarsWeb的API upload_and_publish 来上传发布,接口具体信息可以看到 TarsWeb 的接口文档,TarsGo的cmake管理的项目中可以直接通过make命令上传发布,实际上也是通过Web的API,具体用法可以参考TarsGo的关于cmake管理项目的文档
https://doc.tarsyun.com/adminer/start/index.html#/tarsdoc/dev/tarsgo/spec.md 其实可以用cmake来管理代码, 可以直接make upload来上传
日期类型日志的清理只会处理近30个周期的日志文件
我的程序指定的小时周期,因为是测试阶段,过了一个周末,结果上周的日志都未被清理,因为没有写不会触发清理 建议遍历目录下所有文件,用DateWriter.name和后缀做匹配,抠出文件名中表示日期的部分,time.Parse后和Now()做差值 相关方法:tars/util/rogger/logwriter.go DateWriter.cleanOldLogs()
welcome pr~
这个场景确实比较少见,如果有需求可以提个PR @ealyn
Contributing.md / CONTRIBUTING.md
这两个文件在大小写敏感的文件系统(NTFS)上无法共存,并且因此go命令要求不允许同级目录存在此种情况。 建议删除Contributing.md 更多细节: golang/go#33778
That’s a good idea. We’ll add this to the next release.
tars2go 1.1.4 对于返回值非int或者void的生成代码默认Write_int32
比如 vector< EndpointF > findObjectById(string id); 编译报错 cannot use funRet (type []EndpointF) as type int32 in argument to _os.Write_int32 需要将 err = _os.Write_int32(funRet, 0) 改成 err = _os.WriteHead(codec.LIST, 0) if tarsReq.IVersion == basef.TARSVERSION { _os.Reset()
//bug !!!
//err = _os.Write_int32(_funRet_, 0)
err = _os.WriteHead(codec.LIST, 0)
if err != nil {
return err
}
} else if tarsReq.IVersion == basef.TUPVERSION {
_tupRsp_ := tup.NewUniAttribute()
_os.Reset()
//bug !!!
//err = _os.Write_int32(_funRet_, 0)
err = _os.WriteHead(codec.LIST, 0)
if err != nil {
return err
}
_tupRsp_.PutBuffer("", _os.ToBytes())
_tupRsp_.PutBuffer("tars_ret", _os.ToBytes())
_os.Reset()
err = _tupRsp_.Encode(_os)
if err != nil {
return err
}
}
build error when return bool in tars interface file
in .tars file, if I define a function that return bool, like this: interface TestService{ bool process(string cmd); };
The go source code generates by tars2go can’t build successfully. The error is: cannot use funRet (type bool) as type int32 in argument to _os.Write_int32
I can’t reproduce the problem, can you check again and provide the version of tars2go?
关于主控服务 Registry 的健康检查问题
直接寻址模式的都没有健康检查,但是主控服务 Registry 也是直接寻址的,可能是个 bug.
直接寻址模式下,是在调用失败后才会触发熔断。 除了调用主控服务,其他服务一般都不是直接寻址的,而主控服务本身有降级,所以这里不太有必要去优化
A Issue for Dependent Libraries Collection
If you find any dependent libraries in code but never display its open source license in the License file, please comment on this issue, We will update the License file ASAP. You also can pull request to the License file and remember to describe in detail ; ) Welcome to contribute!
atomic 组合之后不再是一个原子操作
期望 op1,op2,op1,op2,op1,op2…. 但有可能是 op1,op1,op1,op2,op2,op2 . 88 行检查 msgID 是否刚好等于 maxInt32,若相等则置为 1。假设 msgID 值为 maxInt32-1 时,有多个执行流分别经过时都不会置为 1,后面的 105 行再多次进行 add 就可能产生负数的 msgID (有符号整数溢出回转为负数),自此之后长时间内都是负数的 id
这个在很久以前就评审过了,主要看的是这个值是用来干什么的,requestid只是用来标记请求的,只要能保证队列中的请求唯一性就好,并不需要强一致,想达到绝对的防止溢出会损失掉不必要的性能,当然你有更好的方案可以提一下pr:D
明白。允许负数的话,就只需避免为 0 就行了,看了代码,RequestID 值为 0 专用于 server 推送消息给 client ,让 client 主动 close()。 #212
如果真不想有负数出现,就只能改成 uint32 了,但这样估计改动大,也有点吹毛求疵了。估计 RequestID 设计为有符号的是因为 java 没有无符号整数吧
Gracefully patch+publish from TarsWeb
Hi, 我看TarsGo目前已经从Admin发送命令的优雅重启。但是TarsWeb上,传包发布的时候,还不是优雅重启,请问是否可以支持? 相关链接:TarsCloud/TarsWeb#62
Support by patch TarsCloud/TarsFramework#63 TarsCloud/TarsWeb#67
Make NewServantProxy public to enable user to develop custom gateway server for tars services
tars/servant.go: func NewServantProxy(comm *Communicator, objName string) *ServantProxy { return newServantProxy(comm, objName) }
Tars provides the gateway server: https://github.com/TarsCloud/TarsGateway, why do you want to develop custom gateway?
Tars provides the gateway server: https://github.com/TarsCloud/TarsGateway, why do you want to develop custom gateway?
自己实现网关可以实现除了http以外的其他传输接入方式,比如TCP socket, websocket 而且,发这个issue的时候TarsGateway还不存在
Stat and propery report lose effectiveness when Tars-Go client is not within Tars framework
I have a golang web project written in gin,not within Tars framework。When I call Tars server using Tars-Go client, I found that RPC call is normal , but stat and property report lose effectiveness and no data in tars_stat_* and tars_property_* table. Hope this problem can be solved in next version.
该issue长期未更新。如果问题依旧没解决,欢迎重新打开issue。TARS社区有您更精彩。 Thanks for your supporting. The issue has not been updated for a long time. If the problem is still not resolved, welcome to reopen the issue.
xorm的字段映射在服务打包部署后无效
我在测试服务时定义了一个struct如下
type User struct {
Id int32 xorm:"id not null pk autoincr INTEGER"
UserName string xorm:"username VARCHAR(255)"
Account int32 xorm:"account INTEGER"
}
在本地服务器测试的时候可以将UserName映射到数据库中的username字段 但是当我打包服务上传到服务器执行client时则映射无效,但xorm的其他功能正常 可能有什么解决方法呢?
该issue长期未更新。如果问题依旧没解决,欢迎重新打开issue。TARS社区有您更精彩。 Thanks for your supporting. The issue has not been updated for a long time. If the problem is still not resolved, welcome to reopen the issue.
Unpredictable output in FlushLogger
import “github.com/TarsCloud/TarsGo/tars/util/rogger”
func main() { defer rogger.FlushLogger() lg := rogger.GetLogger(“”) for i := 0; i < 20; i++ { lg.Debug(“OK”, i) } }``` The log output of this program has unpredictable order and sometimes losing logs.
If jce or tars define files contain a struct filed , auto genarate files Struct Impletment have a undefined field codec.JceStructBase!
undefined: codec.JceStructBase jce2go version 1.1
create_tars_server.sh rename error in Ubuntu
when i create new server,shell error haha@ubuntu:~$ bash $GOPATH/src/github.com/TarsCloud/TarsGo/tars/tools/create_tars_server.sh MKG TeamServer Team [create server: MKG.TeamServer …] [mkdir: /home/haha/go/src/MKG/TeamServer/]
Now doing:./main.go »» Now doing:./makefile »» Now doing:./start.sh »» Now doing:./config.conf »» Now doing:./Servant_imp.go »» Now doing:./Servant.tars »» Now doing:client/client.go »» Now doing:vendor/vendor.json »» Now doing:debugtool/dumpstack.go »» Bareword “Server” not allowed while “strict subs” in use at (eval 1) line 1. Bareword “Servant” not allowed while “strict subs” in use at (eval 1) line 1. Bareword “tars” not allowed while “strict subs” in use at (eval 1) line 1. Bareword “Servant_imp” not allowed while “strict subs” in use at (eval 1) line 1. Bareword “go” not allowed while “strict subs” in use at (eval 1) line 1. Bareword “Server” not allowed while “strict subs” in use at (eval 1) line 1. Bareword “Servant” not allowed while “strict subs” in use at (eval 1) line 1. Bareword “tars” not allowed while “strict subs” in use at (eval 1) line 1. Bareword “Servant_imp” not allowed while “strict subs” in use at (eval 1) line 1. Bareword “go” not allowed while “strict subs” in use at (eval 1) line 1.
OS:Ubuntu 12:04/16:04 rename in Ubuntu is Perl Program, not C Program rename “Server” “$SERVER” $RENAMEFILE rename “Servant.tars” “${SERVANT}.tars” $RENAMEFILE rename “Servant_imp.go” “${SERVANT_LC}_imp.go” $RENAMEFILE
该issue长期未更新。如果问题依旧没解决,欢迎重新打开issue。TARS社区有您更精彩。 Thanks for your supporting. The issue has not been updated for a long time. If the problem is still not resolved, welcome to reopen the issue.
create_tars_server.sh shell error
when i create new server,shell error sh $GOPATH/src/github.com/TarsCloud/TarsGo/tars/tools/create_tars_server.sh MKG UserInfoServer UserInfo ~/go/src/github.com/TarsCloud/TarsGo/tars/tools/create_tars_server.sh: 12: [: ~/go: unexpected operator ~/go/src/github.com/TarsCloud/TarsGo/tars/tools/create_tars_server.sh: 28: [: UserInfoServer: unexpected operator
OS:Ubuntu 12:04 when i change to Ubuntu 16:04,it’s OK. i find reason in stackoverflow https://stackoverflow.com/questions/3411048/unexpected-operator-in-shell-programming so suggest change ‘sh’ to ‘bash’ in tarsgo document
该issue长期未更新。如果问题依旧没解决,欢迎重新打开issue。TARS社区有您更精彩。 Thanks for your supporting. The issue has not been updated for a long time. If the problem is still not resolved, welcome to reopen the issue.
Support weight for endpoints
TarsGo should support this just like TarsCpp’s implementation: https://github.com/TarsCloud/TarsCpp/blob/master/servant/libservant/EndpointManager.cpp#L853
Shutdown server if servant obj not found in config file
https://github.com/TarsCloud/TarsGo/blob/master/tars/application.go#L283 This line ignore the error, which could cause unpredictable problem. So I suggest to use teerDown function to shutdown server and send a notify message.
TarsGo Can not implement RESTful API
I found TarsGo Use the http package to dispatch request, but the http package can not implement RESTfull API. I want to make a integration with “github.com/gin-gonic/gin” or “github.com/julienschmidt/httprouter”, did you have some other suggestion.
Of course it is easy to be integrated with some web frameworks. Here is an example: package main
import ( “fmt” “net/http”
"github.com/TarsCloud/TarsGo/tars"
"github.com/gorilla/mux" )
func main() { r := mux.NewRouter() r.HandleFunc(“/”, func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) fmt.Fprintf(w, “Home”) }) r.HandleFunc(“/products/{key}”, func(w http.ResponseWriter, r *http.Request) { vars := mux.Vars(r) w.WriteHeader(http.StatusOK) fmt.Fprintf(w, “product: %v\n”, vars[“key”]) })
cfg := tars.GetServerConfig()
tarsMux := tars.TarsHttpMux{}
tarsMux.Handle("/", r)
tars.AddHttpServant(&tarsMux, cfg.App+"."+cfg.Server+".MainObj") // use `not TARS` protocol
tars.Run() }
请问哪个函数可以实现往服务管理>服务实时状态(图中箭头指的地方)发消息,然后在tars的前端显示出来呢?
首先要从模版配置里面获得 tars/application/server - notify - tars.tarsnotify.NotifyObj的值,假设叫做 notify ha := &tars.NotifyHelper{} comm := tars.NewCommunicator() conf := tars.GetServerConfig() ha.SetNotifyInfo(comm, notify, conf.App, conf.Server, conf.Container) ha.ReportNotifyInfo(“Hello, world”) 或者默认的 notify 没改的话,直接 notify := “tars.tarsnotify.NotifyObj” 也可以
can pprof be supported?
I want to use pprof to locate performance issues, it will be supported?
supported
When the implementation method of servant returns int, error, or error which is not nil, it causes the caller to block
The tars file is defined as follows. int updateById(int id, dataInfo DataInfo); My service provider’s code example is roughly as follows func (ci *ServiceImpl) UpdateById(ctx context.Context, Id int32, DataInfo *res.DataInfo) (ret int32, err error) { return PARAM_ERR, errors.New(“param[ModifyUser] invalid”) } I meant to return param_err = - 1 to the caller, The actual situation is that the caller will hold the code until the timeout If you change the code error. New (“param [modifyuser] invalid”) to nil, it is as follows func (ci *ServiceImpl) UpdateById(ctx context.Context, Id int32, DataInfo *res.DataInfo) (ret int32, err error) { return PARAM_ERR, nil } The caller will not hold until the timeout, but will get the result of param_err = - 1 I don’t think this phenomenon is reasonable
该issue长期未更新。如果问题依旧没解决,欢迎重新打开issue。TARS社区有您更精彩。 Thanks for your supporting. The issue has not been updated for a long time. If the problem is still not resolved, welcome to reopen the issue.
Is there a performance checking tool like pprof available?
No description provided.
Maybe you can use pprof in tars manager panel. Step: Services - Operates more - send customer cmd - input “tars.pprof” Reference Code: https://github.com/TarsCloud/TarsGo/blob/master/tars/admin.go#L76 Then you can open “http://your node ip:8080/debug/pprof” to deal with it. Generate svg file: go tool pprof -svg http://your node ip:8080/debug/pprof/profile?seconds=10 Hope it helps you
style: some lines too long and find a typo
tars/communicator.go:20: line is 153 characters (lll) // NewCommunicator returns a new communicator. A Communicator is used for communicating with the server side which should only init once and be global!!! tars/communicator.go:93: line is 123 characters (lll) // GetProperty returns communicator property value as string and true for key, or empty string and false for not exists key tars/endpointmanager.go:218: line is 154 characters (lll) e.pointsSet.Clear() // clean it first,then add back .this action must lead to add lock,but if don’t clean may lead to leakage.it’s better to use remove. tars/filter.go:29: line is 160 characters (lll) type ServerFilter func(ctx context.Context, d Dispatch, f interface{}, req *requestf.RequestPacket, resp *requestf.ResponsePacket, withContext bool) (err error) tars/plugin/zipkintracing/zipkintracing.go:87: line is 157 characters (lll) return func(ctx context.Context, d tars.Dispatch, f interface{}, req *requestf.RequestPacket, resp *requestf.ResponsePacket, withContext bool) (err error) { tars/tools/pb2tarsgo/protoc-gen-go/tarsrpc/tarsrpc.go:198: line is 153 characters (lll) func (obj *%s) Dispatch(ctx context.Context, val interface{}, req * requestf.RequestPacket, resp *requestf.ResponsePacket, withContext bool)(err error){ tars/tools/tars2go/gen_go.go:819: line is 139 characters (lll) c.WriteString(func (_obj * + itf.TName + ) setMap(l int, res *requestf.ResponsePacket, ctx map[string]string, sts map[string]string) { tars/tools/tars2go/gen_go.go:861: line is 130 characters (lll) c.WriteString(“//” + fun.Name + “WithContext is the proxy function for the method defined in the tars file, with the context\n”) tars/tools/tars2go/gen_go.go:1027: line is 148 characters (lll) c.WriteString(func + fun.NameStr +(ctx context.Context, _val interface{},_os *codec.Buffer, _is *codec.Reader, withContext bool)(err error){) tars/tools/tars2go/gen_go.go:1158: line is 155 characters (lll) c.WriteString(“//Dispatch is used to call the server side implemnet for the method defined in the tars file. withContext shows using context or not. \n”) tars/tools/tars2go/gen_go.go:1159: line is 184 characters (lll) c.WriteString(“func(_obj *” + itf.TName + ) Dispatch(ctx context.Context, _val interface{}, req *requestf.RequestPacket, resp *requestf.ResponsePacket,withContext bool) (err error) { tars/tools/tars2go/lex.go:194: line is 128 characters (lll) for isNumber(ls.current) || ls.current == ‘.’ || ls.current == ‘x’ || ls.current == ‘X’ || (isHex && isHexNumber(ls.current)) { tars/util/debug/debugtool.go:58: line is 136 characters (lll) //For example, SigNotifyStack(SIGUSR1, true, “stackinfo”), can dump all goroutine stack when received SIGUSR1 signal by “kill -USR1 pid” tars/rconfig.go:18:20: geting is a misspelling of getting (misspell) //RConf struct for geting remote config.
Finish in #165
pb2tarsgo tool: missing main function
$ go build ./…
github.com/TarsCloud/TarsGo/tars/tools/pb2tarsgo/protoc-gen-go
runtime.main_main·f: function main is undeclared in the main package
https://github.com/TarsCloud/TarsGo/blob/master/tars/tools/pb2tarsgo/README.md Please build the tool according this guide.
Go version 1.13 unit test failed
The test tool of go 1.13 has modified the usage of flag (golang/go@fbc6a97), which conflicts with the application.go’s flag. Cause unit test failure Usage of ./add.test: -config string init config path In addition, if you create a service by yourself and use a flag package, you can’t use a tar package. There are the same problems. It is recommended to modify the application’s flag usage.
该issue长期未更新。如果问题依旧没解决,欢迎重新打开issue。TARS社区有您更精彩。 Thanks for your supporting. The issue has not been updated for a long time. If the problem is still not resolved, welcome to reopen the issue.
httpserver可以正常访问,然后想在httpserver api请求里面访问其tarsserver服务。发现出错。求助。。
goroutine 1 [running, locked to thread]: runtime/debug.Stack(0xc000012c00, 0x15, 0xc00000e0f8) /usr/lib/golang/src/runtime/debug/stack.go:24 +0xa7 github.com/TarsCloud/TarsGo/tars.checkPanic() /www/go/src/github.com/TarsCloud/TarsGo/tars/panic.go:16 +0x16b panic(0x6ad800, 0xc000047760) /usr/lib/golang/src/runtime/panic.go:513 +0x1b9 time.NewTicker(0x0, 0x0) /usr/lib/golang/src/time/tick.go:23 +0x18f github.com/TarsCloud/TarsGo/tars/util/rtimer.NewTimeWheel(0x0, 0x15, 0x0) /www/go/src/github.com/TarsCloud/TarsGo/tars/util/rtimer/timewheel.go:56 +0x124 github.com/TarsCloud/TarsGo/tars/util/rtimer.After(0x0, 0x0) /www/go/src/github.com/TarsCloud/TarsGo/tars/util/rtimer/timewheel.go:25 +0xe1 github.com/TarsCloud/TarsGo/tars.(ObjectProxy).Invoke(0xc00000cd80, 0x75cb80, 0xc0000140a0, 0xc0000aa460, 0x0, 0x0, 0x0) /www/go/src/github.com/TarsCloud/TarsGo/tars/object.go:53 +0x1b8 github.com/TarsCloud/TarsGo/tars.(ServantProxy).Tars_invoke(0xc000069b60, 0x75cb80, 0xc0000140a0, 0xc00012e000, 0x713b17, 0x19, 0xc00011a330, 0x1d, 0x40, 0x0, …) /www/go/src/github.com/TarsCloud/TarsGo/tars/servant.go:71 +0x5b6 github.com/TarsCloud/TarsGo/tars/protocol/res/queryf.(QueryF).FindObjectByIdInSameGroup(0xc000047420, 0x714518, 0x1b, 0xc000137298, 0xc000137280, 0x0, 0x0, 0x0, 0xc000000000, 0x1, …) /www/go/src/github.com/TarsCloud/TarsGo/tars/protocol/res/queryf/QueryF_IF.go:565 +0x1ad github.com/TarsCloud/TarsGo/tars.(EndpointManager).findAndSetObj(0xc00005c6c0, 0xc000047420) /www/go/src/github.com/TarsCloud/TarsGo/tars/endpointmanager.go:198 +0xbf3 github.com/TarsCloud/TarsGo/tars.(EndpointManager).setObjName(0xc00005c6c0, 0x714518, 0x1b) /www/go/src/github.com/TarsCloud/TarsGo/tars/endpointmanager.go:52 +0x3e3 github.com/TarsCloud/TarsGo/tars.(EndpointManager).Init(0xc00005c6c0, 0x714518, 0x1b, 0xc0000512c0, 0x1, 0xc00000cd60) /www/go/src/github.com/TarsCloud/TarsGo/tars/endpointmanager.go:74 +0xee github.com/TarsCloud/TarsGo/tars.(ObjectProxy).Init(0xc00000cd60, 0xc0000512c0, 0x714518, 0x1b) /www/go/src/github.com/TarsCloud/TarsGo/tars/object.go:27 +0x86 github.com/TarsCloud/TarsGo/tars.(ObjectProxyFactory).GetObjectProxy(0xc000137d98, 0x714518, 0x1b, 0x0) /www/go/src/github.com/TarsCloud/TarsGo/tars/object.go:88 +0xf6 github.com/TarsCloud/TarsGo/tars.(ServantProxy).Init(0xc000069aa0, 0xc0000512c0, 0x714518, 0x1b) /www/go/src/github.com/TarsCloud/TarsGo/tars/servant.go:36 +0x11b github.com/TarsCloud/TarsGo/tars.(ServantProxyFactory).GetServantProxy(0xc00000cd40, 0x714518, 0x1b, 0x7) /www/go/src/github.com/TarsCloud/TarsGo/tars/servant.go:114 +0xd1 github.com/TarsCloud/TarsGo/tars.(*Communicator).StringToProxy(0xc0000512c0, 0x714518, 0x1b, 0x7597c0, 0xc000047210) /www/go/src/github.com/TarsCloud/TarsGo/tars/communicator.go:82 +0x42 main.call() /www/go/src/TestApp/WupProxy/WupProxy.go:25 +0xd3 main.init.0() /www/go/src/TestApp/WupProxy/WupProxy.go:11 +0x26
是调用姿势不对 本地运行程序需要自己在配置文件里面加上client配置参数
Error nil pointer will be reported when the service is stopped
Maxinvoke = 0 in setting.go, and there is no other place to modify the value in the project. This parameter is used when adminobj starts. When tcphandle. Handle() is closed, gpool. Release() method is called directly, and there is no operation to judge nil value The code traces that only one gpool has been initialized, and only when maxinvoke > 0. Is there a hidden danger of null pointer in this way?
该issue长期未更新。如果问题依旧没解决,欢迎重新打开issue。TARS社区有您更精彩。 Thanks for your supporting. The issue has not been updated for a long time. If the problem is still not resolved, welcome to reopen the issue.
调研TarGo
TarGo后续计划是如何?会不会继续维护/更新?文档会持续更新吗?
会持续跟进更新
Why is the pattern parameter reported by httpserver.go always “/”
should url.path be reported?
Pattern is taken from handler first. If can’t be got, it will be reported as “/”
The incoming handler is url.path, but it is empty when it comes out of the handler.
Raise a pr to fix it then:D
Using url.path, if someone attack or scan the server, there will be lots of different path reported. Not sure if it is ok for the monitor.
该issue长期未更新。如果问题依旧没解决,欢迎重新打开issue。TARS社区有您更精彩。 Thanks for your supporting. The issue has not been updated for a long time. If the problem is still not resolved, welcome to reopen the issue.
make 脚本建议支持交叉编译参数
目前的make 脚本没有支持交叉编译,我再mac上面编译的二进制文件无法在linux上执行。 执行如下代码 可以设置交叉编译 CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build 建议将这个配置参数化 放到项目的makefile中
需要交叉编译时可以在make命令加上参数, 比如make GOOS=linux, 不建议过多配置.
can we export config field of ServerConfig or add a method to get it ?
I am developing my app based on TarsGo. Now I need to get the config address and notify address in ServerConfig, but current version of TarsGo does not export such two field. Can TarsGo exports this two field of ServerConfig or add a method to get the value of them ? The latter may be better.
invalid memory address or nil pointer dereference error in statf
//StatReport is global. var StatReport *StatFHelper
这个StatReport没有对里面的mutex和list实例化就直接引用,导致pushBackMsg函数里面相关地方panic,报错信息:invalid memory address or nil pointer dereference
mutex和list是有实例化的,在StatFHelper中的Init中定义了
TarsGo/tars/statf.go
Lines 33 to 43
in
2c6dd1e
func (s *StatFHelper) Init(comm *Communicator, node string) {
s.node = node
s.lStatInfo = list.New()
s.lStatInfoFromServer = list.New()
s.mlock = new(sync.Mutex)
s.mStatInfo = make(map[statf.StatMicMsgHead]statf.StatMicMsgBody)
s.mStatCount = make(map[statf.StatMicMsgHead]int)
s.comm = comm
s.sf = new(statf.StatF)
s.comm.StringToProxy(s.node, s.sf)
}
并在initReport中进行了实例化StatReport对象,只有GetClientConfig返回nil时,不会进行实例化
TarsGo/tars/statf.go
Lines 124 to 135
in
2c6dd1e
func initReport() {
if GetClientConfig() == nil {
statInited <- struct{}{}
return
}comm := NewCommunicator()
comm.SetProperty(“netthread”, 1)
StatReport = new(StatFHelper)
StatReport.Init(comm, GetClientConfig().stat)
statInited <- struct{}{}
go StatReport.Run()
}
同时在服务启动时调用initReport来初始化StatReport对象
TarsGo/tars/application.go
Line 155
in
2c6dd1e
go initReport()
所以你的pr中添加的修改和源码中的重复了。没有实例化成功是GetClientConfig返回nil,可以排查一下这方面的原因。 希望以上信息对你有帮助。如果问题已经解决,请关闭相关issue和pr;若有新的问题,可以开启新的issue
非常感谢你的解答!
“This file war generated by tars2go” seems error
This file war generated by tars2go 1.1
The commend in generated files by tars2go seems error, should be This file was generated by tars2go 1.1
fixed 95ae9f1
tarsgo set模式开启问题
基于 targo web 配置好 服务实例Set后,基于模板生成的配置是小写,但是 application 代码当中判断的字符是大写
自动生成的配置文件中 enableset=y
而 application.go 当中65 行判断该配置 为大写字符 Y
if c.GetString(“/tars/application
see #134
如何发送jce请求,可以提供示例
如题,已经生成go版本的jce序列化文件,如何发送jce请求呢?km,github都找不到例子,麻烦尽快完善下
相关例子km是有的,有关jce的问题最好到内网问。 关于如何调用使用tars协议服务的接口,可以在TarsGo文档客户端开发部分查看相关用法。 相关例子可以参考TarsGo/examples/EchoClientServer/EchoClientServer.go,包含了在一个服务中如何调用其它tars协议服务的完整过程 先创建一个全局的*tars.Communicator通信器对象
TarsGo/examples/EchoClientServer/EchoClientServer.go
Line 17
in
2c6dd1e
var comm *tars.Communicator
在需要调用其它服务的时候,新建该服务的proxy对象,该例子中命名为app,同时使用通信器对象函数stringToProxy初始化proxy对象,参数还需要传入调用的服务名。初始化完成后即可通过proxy对象调用对应服务的接口
TarsGo/examples/EchoClientServer/EchoClientServer.go
Lines 35 to 38
in
2c6dd1e
app := new(StressTest.EchoTest)
obj := “StressTest.EchoTestServer.EchoTestObj”
comm.StringToProxy(obj, app)
_, err := app.Echo(strIn, &strOut)
希望以上信息对你有帮助
windows 安装 tars
目前tars没有支持windows安装和运行吗?如果支持的话,麻烦给下安装教程
https://github.com/TarsCloud/Tars README这边说:TARS只支持在Linux操作系统上部署
Start http server fail
When I build a http Server with TarsGo, there are erros: 2019-08-19 16:22:59|application.go:186|DEBUG|RunAdminObj&{tcp 127.0.0.1:10014 0 500ms 0s 0s 0s 10m0s 10000000 134217728 134217728 false} 2019-08-19 16:22:59|servant.go:74|ERROR|Invoke Obj:,fun:reportVersion,error:no adapter Proxy selected: 2019-08-19 16:22:59|statf.go:166|DEBUG|report err:servant name () format error 2019-08-19 16:22:59|servant.go:74|ERROR|Invoke Obj:,fun:keepAlive,error:no adapter Proxy selected: 2019-08-19 16:22:59|nodef.go:44|ERROR|report Version fail: 2019-08-19 16:22:59|statf.go:166|DEBUG|report err:servant name () format error 2019-08-19 16:22:59|nodef.go:36|ERROR|keepalive fail:
How could I solve those errors?
Can you provide your config file and how you start your server ?
just start by sh start.sh
我这边也碰到类似的问题了。 【错误日志】: 2019-08-27 11:57:38|statf.go:48|DEBUG|report statList.size:0 2019-08-27 11:57:38|servant.go:74|ERROR|Invoke Obj:,fun:reportMicMsg,error:no adapter Proxy selected: 2019-08-27 11:57:38|statf.go:166|DEBUG|report err:servant name () format error 2019-08-27 11:57:38|statf.go:85|DEBUG|report err:no adapter Proxy selected: 2019-08-27 11:57:38|statf.go:87|DEBUG|report ret:0 2019-08-27 11:57:38|statf.go:101|DEBUG|stat report 2019-08-27 11:57:38|servant.go:74|ERROR|Invoke Obj:,fun:keepAlive,error:no adapter Proxy selected: 2019-08-27 11:57:38|statf.go:166|DEBUG|report err:servant name () format error 2019-08-27 11:57:38|nodef.go:36|ERROR|keepalive fail:AdminAdapter 【配置】: cat GoTarsServer.conf
app=amc server=GoTarsServer local=tcp -h 127.0.0.1 -p 15692 -t 30000 logpath=/data/tars/app_log
【进程】: root 27436 1 0 11:37 pts/2 00:00:00 ./GoTarsServer –config=GoTarsServer.conf root 27674 11857 0 11:39 pts/2 00:00:00 sudo ./GoTarsServer –config=GoTarsServer.conf 【怀疑】: 是因为手工起的进程,没有通过管理端注册引起的。(管理端部署出问题了。)
just start by sh start.sh
The protocol field should be not_tars.
我这边也碰到类似的问题了。 【错误日志】: 2019-08-27 11:57:38|statf.go:48|DEBUG|report statList.size:0 2019-08-27 11:57:38|servant.go:74|ERROR|Invoke Obj:,fun:reportMicMsg,error:no adapter Proxy selected: 2019-08-27 11:57:38|statf.go:166|DEBUG|report err:servant name () format error 2019-08-27 11:57:38|statf.go:85|DEBUG|report err:no adapter Proxy selected: 2019-08-27 11:57:38|statf.go:87|DEBUG|report ret:0 2019-08-27 11:57:38|statf.go:101|DEBUG|stat report 2019-08-27 11:57:38|servant.go:74|ERROR|Invoke Obj:,fun:keepAlive,error:no adapter Proxy selected: 2019-08-27 11:57:38|statf.go:166|DEBUG|report err:servant name () format error 2019-08-27 11:57:38|nodef.go:36|ERROR|keepalive fail:AdminAdapter 【配置】: cat GoTarsServer.conf app=amc server=GoTarsServer local=tcp -h 127.0.0.1 -p 15692 -t 30000 logpath=/data/tars/app_log
【进程】: root 27436 1 0 11:37 pts/2 00:00:00 ./GoTarsServer –config=GoTarsServer.conf root 27674 11857 0 11:39 pts/2 00:00:00 sudo ./GoTarsServer –config=GoTarsServer.conf 【怀疑】: 是因为手工起的进程,没有通过管理端注册引起的。(管理端部署出问题了。)
看起来配置文件并不完整,可以查看 logpath 下的服务日志,看看是否有错误信息
该issue长期未更新。如果问题依旧没解决,欢迎重新打开issue。TARS社区有您更精彩。 Thanks for your supporting. The issue has not been updated for a long time. If the problem is still not resolved, welcome to reopen the issue.
tars decode returns EOF when missing required field
I figured out that when missing required field, clients would got an EOF error. The error message is confusing, we expect it to be something like missing required field, tag xxx rather than EOF. After some debugs, we found out that the code generated by the tars2go tool didn’t handle error properly. The following line should check error and return directly when error occured. https://github.com/TarsCloud/TarsGo/blob/master/tars/tools/tars2go/gen_go.go#L666 st.ReadFrom(_is)
fixed by #139
panic.go 里 checkPanic 遇到 panic 直接退出进程是否合理
// panic.go package tars
import ( “fmt” “os” “path/filepath” “runtime/debug” “time” )
func checkPanic() { if r := recover(); r != nil { path, _ := filepath.Abs(filepath.Dir(os.Args[0])) os.Chdir(path) file, _ := os.Create(fmt.Sprintf(“panic.%s”, time.Now().Format(“20060102-150405”))) file.WriteString(string(debug.Stack())) file.Close() os.Exit(-1) // 这里直接退出进程合理么? } } 请教一个问题。有一个疑问,如果作为 server 的代码不慎出现了 panic,这里会检查之后直接退出进程,会导致后续的请求无法处理,这样是否是合理的呢?内置的 http server 遇到panic会recover不会退出进程,这里为何直接退出了呢?
Tarsgo service deployment failed, and tarscpp can succeed, how to solve it?
Phenomenon: “error: system internal error” in service deployment Log: {“level”:”error”,”message”:”10.32.219.160|admin|DeployServerController.js:64|[getServerNotifyList] SequelizeDatabaseError: Data truncated for column ‘server_type’ at row 1\n at Query.formatError (/data/home/jammyxu/src/github.com/TarsCloud/TarsWeb/node_modules/sequelize/lib/dialects/mysql/query.js:247:16)\n at Query.handler [as onResult] (/data/home/jammyxu/src/github.com/TarsCloud/TarsWeb/node_modules/sequelize/lib/dialects/mysql/query.js:68:23)\n at Query.execute (/data/home/jammyxu/src/github.com/TarsCloud/TarsWeb/node_modules/mysql2/lib/commands/command.js:30:14)\n at Connection.handlePacket (/data/home/jammyxu/src/github.com/TarsCloud/TarsWeb/node_modules/mysql2/lib/connection.js:449:32)\n at PacketParser.Connection.packetParser.p [as onPacket] (/data/home/jammyxu/src/github.com/TarsCloud/TarsWeb/node_modules/mysql2/lib/connection.js:72:12)\n at PacketParser.executeStart (/data/home/jammyxu/src/github.com/TarsCloud/TarsWeb/node_modules/mysql2/lib/packet_parser.js:75:16)\n at Socket.Connection.stream.on.data (/data/home/jammyxu/src/github.com/TarsCloud/TarsWeb/node_modules/mysql2/lib/connection.js:79:25)\n at emitOne (events.js:116:13)\n at Socket.emit (events.js:211:7)\n at addChunk (_stream_readable.js:263:12)\n at readableAddChunk (_stream_readable.js:250:11)\n at Socket.Readable.push (_stream_readable.js:208:10)\n at TCP.onread (net.js:594:20) “,”timestamp”:”2019-08-14 16:55:45.588”}
Does your problem still exist? If yes, can you provide more detailed information, such as configuration, template and type selection when deploying services.
该issue长期未更新。如果问题依旧没解决,欢迎重新打开issue。TARS社区有您更精彩。 Thanks for your supporting. The issue has not been updated for a long time. If the problem is still not resolved, welcome to reopen the issue.
When can go module be supported?
No description provided.
+1
enableset NOT working
We’ve encounter a problem when deploy services with set division. The code below expect enableset=Y to take effect https://github.com/TarsCloud/TarsGo/blob/dev/tars/application.go#L82 but the config file generated by NodeServer contains the following line: enableset=y
This mismatch disables set division deployment.
Why are the jobs distributed ?
Why don’t workers go directly to grab jobs from the pool? Based on what considerations? You can use fewer channels, which should reduce the performance loss. For example: func (w *Worker) Start() { go func() { for { select { case job = <-pool.JobQueue: job() case <-w.Stop: w.Stop <- struct{}{} return } } }() }
What do u mean by distributing jobs?
It means that multiple workers consume the same channel, and the worker takes the initiative to obtain tasks to execute, rather than the scheduler to dispatch. There are relevant codes posted on it
The design here should refer to the working threads in CPP. At the beginning, CPP was designed for multi-core utilization, and multiple working threads were processed in parallel.
该issue长期未更新。如果问题依旧没解决,欢迎重新打开issue。TARS社区有您更精彩。 Thanks for your supporting. The issue has not been updated for a long time. If the problem is still not resolved, welcome to reopen the issue.
Is there any way to run make tars under windows
Is there any way to run make tars under windows
Currently, it only supports development under Linux, and there is no way to run it under windows at present
tars2go将多个jce转go
当一个jce引用其他jce文件时,在jce的所在目录执行tars2go才能转换,否则会报错。请问一下这是怎么解决的
补充一下,这里提到的jce就是.tars协议文件
jce问题到内网里提issue吧
Where is tests?
No description provided.
Do u mean unit tests?
[alarm] zombie process,no keep alive msg for 60 seconds
使用该docker镜像搭建了tars的管理平台,并根据tar_go_quickstart.md搭建了服务端,并打包上传到服务平台,服务日志一直报服务为僵尸进程
后查看服务的配置运行的配置文件发现servant均少了Obj字样