Skip to content
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

\GatewayClient\Gateway::sendToGroup在高并发场景中很难确保发送成功 #77

Open
tourze opened this issue May 24, 2021 · 1 comment

Comments

@tourze
Copy link

tourze commented May 24, 2021

最近在一个大流量活动中使用了Workerman/GatewayWorker,发现在后台群推消息时,偶发会出现部分接收方无法接收消息的问题。

日志中表现为:

image

大概就是在

        } // 运行在其它环境中,通过注册中心得到gateway地址
        else {
            $addresses = static::getAllGatewayAddressesFromRegister();
            foreach ($addresses as $address) {
                $gateway_data['ext_data'] = isset($address_connection_array[$address]) ?
                    json_encode(array('group'=> $group, 'exclude'=> $address_connection_array[$address])) :
                    $default_ext_data_buffer;
                static::sendToGateway($address, $gateway_data);
            }
        }

这里获取得到gateway地址后循环调用发送。但是如果循环过程中有一个gateway挂了,后面就无法发送了。

@caiqy
Copy link

caiqy commented Jun 2, 2021

我当初遇到的好像也是这个问题,自己读代码解决了,前提是你已经按照官方文档做了系统优化了,也使用了event扩展

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants