gateway服务端异常退出

speed

bug描述

项目中有同时建立TCP和WebSocket服务,设备TCP连接,监控端连接ws连接,目的是为了将数据直接推送到监控端实时展示。

数据量测试时约为每秒3~5条数据

最近发现,当监控端异常断开后,比如监控端的电脑休眠了,服务端没有正常检测到监控端退出,会导致服务端的服务停止

系统环境

php 7.3.31
已经配置了WebSocket心跳间隔

$gateway->pingInterval = 60;
$gateway->pingNotResponseLimit = 1;

异常错误信息

2023-02-11 21:03:50 pid:707931 Workerman[start.php] stopping ...
2023-02-11 21:03:50 pid:707932 worker[707932] remains 6 connection(s)
2023-02-11 21:03:50 pid:707932 worker[707932] remains 3 connection(s)
2023-02-11 21:03:50 pid:707932 worker[707932] remains 0 connection(s)
2023-02-11 21:03:50 pid:752087 worker[752087] remains 4 connection(s)
2023-02-11 21:03:50 pid:752085 worker[752085] remains 4 connection(s)
2023-02-11 21:03:50 pid:752088 worker[752088] remains 4 connection(s)
2023-02-11 21:03:50 pid:752086 worker[752086] remains 4 connection(s)
2023-02-11 21:03:50 pid:707936 worker[707936] remains 4 connection(s)
2023-02-11 21:03:50 pid:707939 worker[707939] remains 6 connection(s)
2023-02-11 21:03:50 pid:707938 worker[707938] remains 4 connection(s)
2023-02-11 21:03:50 pid:707931 worker[TTBusinessWorker:707932] exit with status 65280
2023-02-11 21:03:50 pid:707934 worker[707934] remains 6 connection(s)
2023-02-11 21:03:50 pid:707934 worker[707934] remains 3 connection(s)
2023-02-11 21:03:50 pid:707934 worker[707934] remains 0 connection(s)
2023-02-11 21:03:50 pid:707937 worker[707937] remains 4 connection(s)
2023-02-11 21:03:50 pid:707931 worker[TTBusinessWorker:707934] exit with status 65280
2023-02-11 21:03:51 pid:707935 worker[707935] remains 6 connection(s)
2023-02-11 21:03:51 pid:707935 worker[707935] remains 3 connection(s)
2023-02-11 21:03:51 pid:707935 worker[707935] remains 0 connection(s)
2023-02-11 21:03:51 pid:752085 worker[752085] remains 2 connection(s)
2023-02-11 21:03:51 pid:752087 worker[752087] remains 2 connection(s)
2023-02-11 21:03:51 pid:752088 worker[752088] remains 2 connection(s)
2023-02-11 21:03:51 pid:752086 worker[752086] remains 2 connection(s)
2023-02-11 21:03:51 pid:707938 worker[707938] remains 2 connection(s)
2023-02-11 21:03:51 pid:707936 worker[707936] remains 2 connection(s)
2023-02-11 21:03:51 pid:707931 worker[TTBusinessWorker:707935] exit with status 65280
2023-02-11 21:03:51 pid:707933 worker[707933] remains 6 connection(s)
2023-02-11 21:03:51 pid:707933 worker[707933] remains 3 connection(s)
2023-02-11 21:03:51 pid:707933 worker[707933] remains 0 connection(s)
2023-02-11 21:03:51 pid:707937 worker[707937] remains 2 connection(s)
2023-02-11 21:03:51 pid:707939 worker[707939] remains 3 connection(s)
2023-02-11 21:03:51 pid:707940 worker[707940] remains 8 connection(s)
2023-02-11 21:03:51 pid:707931 worker[TTBusinessWorker:707933] exit with status 65280
2023-02-11 21:03:52 pid:707939 SendBufferToWorker fail. The connections between Gateway and BusinessWorker are not ready. See http://doc2.workerman.net/send-buffer-to-worker-fail.html
2023-02-11 21:03:52 pid:707939 SendBufferToWorker fail. The connections between Gateway and BusinessWorker are not ready. See http://doc2.workerman.net/send-buffer-to-worker-fail.html
2023-02-11 21:03:52 pid:707937 SendBufferToWorker fail. The connections between Gateway and BusinessWorker are not ready. See http://doc2.workerman.net/send-buffer-to-worker-fail.html
2023-02-11 21:03:52 pid:707937 SendBufferToWorker fail. The connections between Gateway and BusinessWorker are not ready. See http://doc2.workerman.net/send-buffer-to-worker-fail.html
2023-02-11 21:03:55 pid:707939 SendBufferToWorker fail. The connections between Gateway and BusinessWorker are not ready. See http://doc2.workerman.net/send-buffer-to-worker-fail.html
2023-02-11 21:03:55 pid:707939 SendBufferToWorker fail. The connections between Gateway and BusinessWorker are not ready. See http://doc2.workerman.net/send-buffer-to-worker-fail.html

是否因为实际监控端不在线,导致推送的消息失败引发的故障呢? 应该怎样才能处理? 谢谢。

1027 1 0
1个回答

keytehu

2023-02-11 21:03:50 pid:707931 Workerman[start.php] stopping ...

这条日志之前的日志是啥?看起来是执行了php start.php stop -g 呢。

还有你也没贴workerman版本

  • speed 2023-02-12

    谢谢您的回复,前面没有日志了,停止之前没有提示什么。上一条日志就是之前手动操作停止的记录

    2023-02-11 17:30:22 pid:707931 worker[TTWebsocket:707941] exit with status 64000
    2023-02-11 17:30:22 pid:707931 worker[TTWebsocket:707942] exit with status 64000
    2023-02-11 17:30:22 pid:707931 worker[TTWebsocket:707944] exit with status 64000
    2023-02-11 17:30:22 pid:707931 worker[TTWebsocket:707943] exit with status 64000
    2023-02-11 21:03:50 pid:707931 Workerman[start.php] stopping ...
    2023-02-11 21:03:50 pid:707932 worker[707932] remains 6 connection(s)
    2023-02-11 21:03:50 pid:707932 worker[707932] remains 3 connection(s)
    2023-02-11 21:03:50 pid:707932 worker[707932] remains 0 connection(s)
    2023-02-11 21:03:50 pid:752087 worker[752087] remains 4 connection(s)
    ......

    workerman 版本是 4.0.27
    gateway-worker 版本是 3.0.22

  • walkor 2023-02-12

    workerman 4.0.27 4.0.28 debug方式运行时,终端断开信号处理有点问题,升级下workerman

年代过于久远,无法发表回答
×
🔝