Giter Site home page Giter Site logo

Register auth timeout about gatewayclient HOT 7 CLOSED

Mr-ZeroX avatar Mr-ZeroX commented on July 30, 2024
Register auth timeout

from gatewayclient.

Comments (7)

walkor avatar walkor commented on July 30, 2024

客户端指的是正常的客户端,不是GatewayClient。
如果不影响你的程序,忽略即可。

from gatewayclient.

Mr-ZeroX avatar Mr-ZeroX commented on July 30, 2024

想起来了,我每回第一次调用 \GatewayClient\Gateway::XXX 方法的时候,都会抛出错误:
getAllGatewayAddressesFromRegister fail. tcp://xx.xx.xx.xx:1238 return false

我是自己加了个异常捕获,捕获之后再请求一次就没问题。准确地说是之后 10s 内的其它请求没有问题了。貌似就是第一次请求的失败引出了 Register auth timeout 这个错误。

然后我看 workerman/gateway-worker/src/Register.php 的源码里有个 10s 的定时器,不知道这个跟第一次请求失败有什么关联,想请教一下。

    /**
     * 设置个定时器,将未及时发送验证的连接关闭
     *
     * @param \Workerman\Connection\ConnectionInterface $connection
     * @return void
     */
    public function onConnect($connection)
    {
        $connection->timeout_timerid = Timer::add(10, function () use ($connection) {
            self::log("Register auth timeout (".$connection->getRemoteIp()."). See http://wiki.workerman.net/Error4 for detail");
            $connection->close();
        }, null, false);
    }

from gatewayclient.

walkor avatar walkor commented on July 30, 2024

php start.php status
贴下

from gatewayclient.

Mr-ZeroX avatar Mr-ZeroX commented on July 30, 2024

这是正在跑的三个模块的状态:

Workerman[start_register.php] status
---------------------------------------GLOBAL STATUS--------------------------------------------
Workerman version:3.3.9          PHP version:5.6.9
start time:2017-04-20 10:13:31   run 0 days 0 hours
load average: 0, 0.01, 0.05      event-loop:React
1 workers       1 processes
worker_name  exit_status     exit_count
Register     0                0
---------------------------------------PROCESS STATUS-------------------------------------------
pid     memory  listening           worker_name  connections total_request send_fail throw_exception
14345   1.5M    text://0.0.0.0:1238 Register     14          20             0         0
Workerman[start_gateway.php] status
---------------------------------------GLOBAL STATUS--------------------------------------------
Workerman version:3.3.9          PHP version:5.6.9
start time:2017-04-20 10:13:36   run 0 days 0 hours
load average: 0, 0.01, 0.05      event-loop:React
1 workers       4 processes
worker_name  exit_status     exit_count
AddMe        0                0
---------------------------------------PROCESS STATUS-------------------------------------------
pid     memory  listening                worker_name  connections total_request send_fail throw_exception
14350   2M      websocket://0.0.0.0:8282 AddMe        11          41             0         0
14349   2M      websocket://0.0.0.0:8282 AddMe        10          69             0         0
14351   2M      websocket://0.0.0.0:8282 AddMe        9           67             0         0
14352   2M      websocket://0.0.0.0:8282 AddMe        9           46             0         0
Workerman[start_businessworker.php] status
---------------------------------------GLOBAL STATUS--------------------------------------------
Workerman version:3.3.9          PHP version:5.6.9
start time:2017-04-20 10:13:42   run 0 days 0 hours
load average: 0, 0.01, 0.05      event-loop:React
1 workers       8 processes
worker_name           exit_status     exit_count
YourAppBusinessWorker 0                0
---------------------------------------PROCESS STATUS-------------------------------------------
pid     memory  listening    worker_name           connections total_request send_fail throw_exception
14361   2.25M   none         YourAppBusinessWorker 5           73             0         0
14356   2.25M   none         YourAppBusinessWorker 5           73             0         0
14359   3M      none         YourAppBusinessWorker 5           78             0         0
14362   2.25M   none         YourAppBusinessWorker 5           73             0         0
14360   3M      none         YourAppBusinessWorker 5           85             0         0
14358   2.25M   none         YourAppBusinessWorker 5           77             0         0
14357   3M      none         YourAppBusinessWorker 5           101            0         0
14363   3M      none         YourAppBusinessWorker 5           105            0         0

from gatewayclient.

Mr-ZeroX avatar Mr-ZeroX commented on July 30, 2024

我打印了下 workerman/gatewayclient/Gateway.phpgetAllGatewayAddressesFromRegister 方法里一些网络调用的结果。
第一次运行,$client 返回的是一个资源 resource(4) of type (stream),但是 $retfalse,就报错了;第二次运行正常。

from gatewayclient.

walkor avatar walkor commented on July 30, 2024

ReactPHP的一个bug导致的,安装个event扩展就好了。回头我手册说明下。
http://wenda.workerman.net/?/question/1828

from gatewayclient.

Mr-ZeroX avatar Mr-ZeroX commented on July 30, 2024

好的,多谢!

from gatewayclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.