赵健

Results 11 comments of 赵健

> 频繁发生? 发生概率不频繁,运行3天后才出现的

> 有看到 `error occurs in event-loop: ` 的错误日志吗?没有的话应该是你在 OnTraffic() 里 return Shutdown 导致的。 日志文件仅包含[email protected]/reactor_default_linux.go:124 event-loop(6) is exiting due to error: server is going to be shutdown 2023/01/12 16:48:45 Init config...

自己写的部分全局都没使用Shutdown ![image](https://user-images.githubusercontent.com/37969767/212219484-0252744a-0c4e-4470-933d-165661fe6f06.png)

![image](https://user-images.githubusercontent.com/37969767/212219576-091ebd4b-25b7-4f60-a54c-645f76f5223d.png) 日志都是正常的,就多了一行异常日志

> OnClose() 和 OnTick() 里有没有返回 Shutdown?或者其他可能的地方,你全局搜一下 `Shutdown` 看看?一般来说这个错误是人为触发的,你看看你自己的业务代码有没有哪里有错误日志? 有类似Kill命令会触发Shutdown吗

> 暂时想不到还有什么情况会出现这种情况。你能提供一下能复现这个问题的 demo 代码吗? ```go type netServer struct { gnet.BuiltinEventEngine eng gnet.Engine network string addr string multicore bool } func (s *netServer) OnBoot(eng gnet.Engine) gnet.Action { logger.Infof("running server on %s...

上面的就是项目中关于gnet的全部代码了

gnet服务启动是在一个协程内启动的,单独的gnet shutdown会导致整个进程断掉吗

> > gnet服务启动是在一个协程内启动的,单独的gnet shutdown会导致整个进程断掉吗 > > 什么意思?你是主动调用了 [gnet.Stop](https://pkg.go.dev/github.com/panjf2000/gnet/v2#Stop) 方法吗? 没主动调用 gnet.Stop方法,项目设计的gnet部分代码全部在上面了,上面的 InitPtrServer() 是 go InitPtrServer() 通过协程方式启动的,[email protected]/reactor_default_linux.go:124 event-loop(6) is exiting due to error: server is going to be shutdown 日志会导致整个进程断掉吗