Comments (3)
我也遇到这个卡住不退出的情况,跟了一下代码,根本原因是死锁问题导致的。
在调用Server.Stop() 的时候,执行了:
s.ConnMgr.ClearConn() <------(1)
在ClearConn() 中,执行了conn.Stop()。
在conn.Stop()中又调用了ConMgr的Remove() <------(2)
在(1)和(2)中都要拿到锁connMgr.connLock.Lock(),所以在调用Remove()的时候就卡住了,这应该是一个bug。
from zinx.
@lauber00 感谢,刚才检查了代码,确实是这种情况,删除了 ClearConn
里面的锁来解决了。
from zinx.
这问题似乎没有提交给维护团队, 那大家都直接魔改源码么
from zinx.
Related Issues (20)
- zinx这种情况是否需要加锁 HOT 1
- CPU百分百-不懂就问系列 HOT 3
- 消息ID HOT 1
- connection StartReader 处理数据,解码之后只有数据前8位,导致数据丢失 HOT 11
- 冰哥,最新更新消息丢给责任链这个源码,看不懂,能不能开个教程啊! HOT 4
- 连接id,只能固定系统自动生成吗? HOT 2
- [Bug]: 程序卡死 HOT 5
- Join the Zinx community (加入Zinx Issue讨论社区)
- 针对自定义的消息体实现IMessage,如何定义?
- 请教一个关于多server的问题 HOT 1
- 生产环境下的log HOT 1
- connection.go can't use c.cancel() HOT 1
- 2个问题 HOT 2
- 请教一个问题
- Support http interface HOT 1
- websocket 可以支持 TextMessage格式吗 HOT 1
- 责任链(chain)代码疑问
- v1.1.1运行mmo_game_client出现报错,求指教w HOT 1
- 头部内容固定,脏数据不能处理,一直阻塞到半包 HOT 3
- [feat]: 配置参数可以通过环境变量覆盖 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zinx.