FreeABC
记忆重叠

workerman exception ‘Exception’ with message ‘event-loop exited 完美解决方案

前几天看workerman 升级了,

就直接composer update 升级了一下

结果今天发现workerman.log把我的磁盘分区写满了,

具体内容如下。

 

2017-06-08 11:37:57 pid:20353 WORKER EXIT UNEXPECTED 
2017-06-08 11:37:57 pid:28934 worker[FileMonitor:20353] exit with status 64000
2017-06-08 11:37:57 pid:20354 exception 'Exception' with message 'event-loop exited' in /opt/neimu_wm/vendor/workerman/workerman/Worker.php:960
Stack trace:
#0 /opt/neimu_wm/vendor/workerman/workerman/Worker.php(922): Workerman\Worker::forkOneWorker(Object(Workerman\Worker))
#1 /opt/neimu_wm/vendor/workerman/workerman/Worker.php(1075): Workerman\Worker::forkWorkers()
#2 /opt/neimu_wm/vendor/workerman/workerman/Worker.php(433): Workerman\Worker::monitorWorkers()
#3 /opt/neimu_wm/start.php(37): Workerman\Worker::runAll()
#4 {main}
2017-06-08 11:37:57 pid:20354 WORKER EXIT UNEXPECTED 
2017-06-08 11:37:57 pid:28934 worker[FileMonitor:20354] exit with status 64000
2017-06-08 11:37:57 pid:20355 exception 'Exception' with message 'event-loop exited' in /opt/neimu_wm/vendor/workerman/workerman/Worker.php:960
Stack trace:
#0 /opt/neimu_wm/vendor/workerman/workerman/Worker.php(922): Workerman\Worker::forkOneWorker(Object(Workerman\Worker))
#1 /opt/neimu_wm/vendor/workerman/workerman/Worker.php(1075): Workerman\Worker::forkWorkers()
#2 /opt/neimu_wm/vendor/workerman/workerman/Worker.php(433): Workerman\Worker::monitorWorkers()
#3 /opt/neimu_wm/start.php(37): Workerman\Worker::runAll()
#4 {main}
2017-06-08 11:37:57 pid:20355 WORKER EXIT UNEXPECTED 
2017-06-08 11:37:57 pid:28934 worker[FileMonitor:20355] exit with status 64000

 

 

尝试解决

1、重启服务,php start.php  start

命令行没有提示任何错误。OK 

天真的我以为这样就结束了

保险起见,我有重新tailf vendor/workerman/workerman.log

泥煤哦,这错误还在狂闪

 

代码也没啥异常了,

到群里问了一下

【活跃】jocke 2017/6/8 11:36:33
这个是什么情况?
【群主】walkor 2017/6/8 11:37:04
监听个端口就好了

【活跃】jocke 2017/6/8 11:38:23
这报错直接把磁盘写满了。。。

【群主】walkor 2017/6/8 11:40:22
FileMonitor里

【群主】walkor 2017/6/8 11:41:38
只写一条你们发现不了,不处理就给你写满,就发现了

【潜水】JL 2017/6/8 11:41:52
哈哈哈哈说得对

【潜水】JL 2017/6/8 11:42:04
磁盘异常日志满了,才发现有bug

 

群主说得监听一个端口。。

仔细看来 一下日志里面提示 

2017-06-08 11:37:57 pid:28934 worker[FileMonitor:20353] exit with status 64000

 

于是找到 这个文件

<?php
use Workerman\Worker;
use Workerman\Lib\Timer;

// 默认监控Workerman的Applications目录
$monitor_dir = realpath(__DIR__.'/..');
// worker
//$worker = new Worker();// 把这段换成下面内容
$worker = new Worker('text://0.0.0.0:2119');
// 名称,方便status时候辨别
$worker->name = 'FileMonitor';
// 该进程收到reload信号不执行reload
$worker->reloadable = false;

 

 

【群主】walkor 2017/6/8 11:49:50
你应该是加载了reactPHP, 如果没有任何监听它的event-loop就会退掉
11:50:53
【活跃】qmore 2017/6/8 11:50:53
加了react就会默认用它的event-loop
【活跃】qmore 2017/6/8 11:51:04
默默删了。。

 

 

保险起见

还是把react 删除的好

php start.php stop

composer remove react/*

php start.php start -d

tailf ./vendor/workerman/workerman.log

2017-06-08 11:38:09 pid:22496 WORKER EXIT UNEXPECTED 
2017-06-08 11:38:09 pid:28934 worker[FileMonitor:22496] exit with status 64000
2017-06-08 11:38:09 pid:28934 Workerman[start.php] has been stopped
2017-06-08 11:38:09 pid:22493 Workerman[start.php] stop success
2017-06-08 11:46:19 pid:23042 Workerman[start.php] start in DAEMON mode
2017-06-08 11:48:03 pid:23183 Workerman[start.php] status 

 

一切顺心啦,以后一定要注意,升级新版本之后,多检查一下运行日志。

愿我踩的这个坑不在有人跌下去
未经允许不得转载:Free-Abc智能 » workerman exception ‘Exception’ with message ‘event-loop exited 完美解决方案
分享到: 更多 (0)