can not connect to tcp://xxx Operation now in progress

sxmwhl

请教一下,这种错误一般怎么处理?
原来在一台服务器上部署没有出现过这种问题,把businessworker部署到局域网上后,偶尔会出现以下错误退出。
是因为Gateway太忙了吗?
谢谢!

2019-03-08 21:56:46 pid:32583 Worker process terminated2019-03-08 21:56:46 pid:32577 worker exit with status 64000
2019-03-08 21:56:50 pid:3726 Exception: can not connect to tcp://192.168.9.160:7004 Operation now in progress in /var/www/server/vendor/workerman/gateway-worker/src/Lib/Gateway.php:1143
Stack trace:
#0 /var/www/server/vendor/workerman/gateway-worker/src/Lib/Gateway.php(1092): GatewayWorker\Lib\Gateway::sendAndRecv('192.168.9.160:7...', Array)
#1 /var/www/server/vendor/workerman/gateway-worker/src/BusinessWorker.php(378): GatewayWorker\Lib\Gateway::getSession('c0a809a01b5c000...')
#2 : GatewayWorker\BusinessWorker->onGatewayMessage(Object(Workerman\Connection\AsyncTcpConnection), Array)
#3 /var/www/server/vendor/workerman/workerman/Connection/TcpConnection.php(658): call_user_func(Array, Object(Workerman\Connection\AsyncTcpConnection), Array)
#4 : Workerman\Connection\TcpConnection->baseRead(Resource id #6994, 2, Resource id #6994)
#5 /var/www/server/vendor/workerman/workerman/Events/Event.php(195): EventBase->loop()
#6 /var/www/server/vendor/workerman/workerman/Worker.php(2321): Workerman\Events\Event->loop()
#7 /var/www/server/vendor/workerman/gateway-worker/src/BusinessWorker.php(197): Workerman\Worker->run()
#8 /var/www/server/vendor/workerman/workerman/Worker.php(1452): GatewayWorker\BusinessWorker->run()
#9 /var/www/server/vendor/workerman/workerman/Worker.php(1282): Workerman\Worker::forkOneWorkerForLinux(Object(GatewayWorker\BusinessWorker))
#10 /var/www/server/vendor/workerman/workerman/Worker.php(1256): Workerman\Worker::forkWorkersForLinux()
#11 /var/www/server/vendor/workerman/workerman/Worker.php(1586): Workerman\Worker::forkWorkers()
#12 /var/www/server/vendor/workerman/workerman/Worker.php(1535): Workerman\Worker::monitorWorkersForLinux()
#13 /var/www/server/vendor/workerman/workerman/Worker.php(509): Workerman\Worker::monitorWorkers()
#14 /var/www/server/start.php(45): Workerman\Worker::runAll()
#15 {main}
2019-03-08 21:56:50 pid:3726 Worker process terminated
2019-03-08 21:56:50 pid:32577 worker exit with status 64000
4790 2 0
2个回答

walkor 打赏

报错的时候看下各个服务器的负载是不是高了。有可能是负载高了导致。
另外每台服务器都要装event扩展,并按照手册 http://doc.workerman.net/appendices/kernel-optimization.html 优化linux内核。一般普通内核配置不优化无法承载高并发。

  • sxmwhl 2019-03-13

    都安装有扩展,Gateway的主机安装的libevent, business主机装的event,内核也优化过。
    但是优化内核时这一条好像有问题
    sysctl: cannot stat /proc/sys/net/ipv4/tcp_tw_recycle: No such file or directory
    不知道影响不影响。
    另外在开business主机上开status -d 才出现这样的错误,不开就不会出。看错提示里有

    12 /var/www/server/vendor/workerman/workerman/Worker.php(1535): Workerman\Worker::monitorWorkersForLinux()

    13 /var/www/server/vendor/workerman/workerman/Worker.php(509): Workerman\Worker::monitorWorkers()

    估计跟状态实时查看有关系。
    Gateway主机是有外网的,businessworker主机没有外网的,我是通过Gateway主机,ssh到business主机上开的status -d
    其实,这个错误也影响不大,只是想提供一些线索,供大家参考。

davisLiu

我也遇到这种情况,不知道怎么解决。
也装了扩展,内核也优化了,还是时不时的报这个错误,也没有规律

2020-08-11 07:38:39 pid:4876 exception 'RedisException' with message 'Operation now in progress' in /tosan/command/v2/include/meters.class.php:81
Stack trace:
#0 /tosan/command/v2/include/meters.class.php(81): Redis->connect('r-bp1r053jp8skc...', 6379)
#1 /tosan/command/v2/Applications/app/Events.php(183): Meters->gprs(Array)
#2 [internal function]: Events::onMessage('7f000001206c000...', 'h@p4\x11\x19@\xE8\xC1\x83\x07\x81\n\x00\x00...')
#3 /tosan/command/v2/vendor/workerman/gateway-worker/src/BusinessWorker.php(403): call_user_func('Events::onMessa...', '7f000001206c000...', 'h@p4\x11\x19@\xE8\xC1\x83\x07\x81\n\x00\x00...')
#4 [internal function]: GatewayWorker\BusinessWorker->onGatewayMessage(Object(Workerman\Connection\AsyncTcpConnection), Array)
#5 /tosan/command/v2/vendor/workerman/workerman/Connection/TcpConnection.php(658): call_user_func(Array, Object(Workerman\Connection\AsyncTcpConnection), Array)
#6 [internal function]: Workerman\Connection\TcpConnection->baseRead(Resource id #502, 2, Resource id #502)
#7 /tosan/command/v2/vendor/workerman/workerman/Events/Event.php(195): EventBase->loop()
#8 /tosan/command/v2/vendor/workerman/workerman/Worker.php(2408): Workerman\Events\Event->loop()
#9 /tosan/command/v2/vendor/workerman/gateway-worker/src/BusinessWorker.php(197): Workerman\Worker->run()
#10 /tosan/command/v2/vendor/workerman/workerman/Worker.php(1541): GatewayWorker\BusinessWorker->run()
#11 /tosan/command/v2/vendor/workerman/workerman/Worker.php(1371): Workerman\Worker::forkOneWorkerForLinux(Object(GatewayWorker\BusinessWorker))
#12 /tosan/command/v2/vendor/workerman/workerman/Worker.php(1345): Workerman\Worker::forkWorkersForLinux()
#13 /tosan/command/v2/vendor/workerman/workerman/Worker.php(1675): Workerman\Worker::forkWorkers()
#14 /tosan/command/v2/vendor/workerman/workerman/Worker.php(1624): Workerman\Worker::monitorWorkersForLinux()
#15 /tosan/command/v2/vendor/workerman/workerman/Worker.php(548): Workerman\Worker::monitorWorkers()
#16 /tosan/command/v2/start.php(45): Workerman\Worker::runAll()
#17 {main}
2020-08-11 07:38:39 pid:4876 Worker[4876] process terminated
2020-08-11 07:38:39 pid:11803 worker[NSBusinessworker:4876] exit with status 64000
2020-08-11 08:38:32 pid:15948 Workerman[/tosan/command/v2/start.php] status 
  • 暂无评论
年代过于久远,无法发表回答
×
🔝