New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getCachedClient 存在并发bug #772
Comments
fixed. only forget k when the client is cached. |
我觉得改了之后还是有点问题,当 c.slGroup.Do() 中调用的函数返回后,还没缓存client前,这里仍然会创建一些不被使用的链接。 这里应该直接使用mutex来控制并发就行了 |
这个应该修复了。 |
还是存在问题,当网络延时的时候 c.slGroup.Do(k, func() (interface{}, error) { |
你的rpcx的版本是? |
1.7.15 |
rpcx/client/xclient.go
Lines 282 to 338 in 6d27bc7
上面这段代码存在并发问题,锁的使用存在问题,可能多个线程都拿到了nil的client, c.slGroup.Do似乎只能保证同时创建一个连接,但是c.slGroup.Forget之后可能创建出多个连接,导致连接泄露,创建一些不被使用的连接
The text was updated successfully, but these errors were encountered: