因异步场景需要,我使用了workerman/rabbitmq
这个插件,来处理相关业务。但在停止进程时,stop
指令后,出现以下错误:
进程启动成功,业务是正常处理的。
虽然停止进程是成功的,但是出现一些我比较疑惑的错误,不知道是否因event扩展造成?
$worker = new Worker();
$worker->count = 1;
$worker->onWorkerStart = function () {
(new Client())
->connect()
->then(function (Client $client) {
return $client->channel();
})
->then(function (Channel $channel) {
echo "[*] Waiting for messages. To exit press CTRL+C\n";
$channel->qos(0, 1000, false);
$channel->consume(
function (Message $message, Channel $channel, Client $client) {
$content = !empty($message->content) ? json_decode($message->content, true) : '';
if ($content && is_array($content)) {
$channel->ack($message);
}
},
'logs',
'',
false,
false
);
});
};
$worker::runAll();
PHP Warning: Unknown: Epoll MOD(1) on fd 8 failed. Old events were 6; read change was 0 (none); write change was 2 (del); close change was 0 (none): Bad file descriptor in Unknown on line 0
Warning: Unknown: Epoll MOD(1) on fd 8 failed. Old events were 6; read change was 0 (none); write change was 2 (del); close change was 0 (none): Bad file descriptor in Unknown on line 0
系统版本
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.4.1708 (Core)
Release: 7.4.1708
Codename: Core
PHP版本信息
PHP 7.3.11 (cli) (built: Nov 22 2019 12:34:23) ( ZTS DEBUG )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies
框架及插件版本
{
"require": {
"workerman/workerman": "^4.1",
"workerman/crontab": "^1.0",
"workerman/rabbitmq": "^1.0"
}
}
执行
php --ri event
看下event版本
event
Event support => enabled
Sockets support => enabled
Debug support => disabled
Extra functionality support including HTTP, DNS, and RPC => enabled
OpenSSL support => enabled
Thread safety support => disabled
Extension version => 2.3.0
libevent2 headers version => 2.1.8-stable
试下升级event扩展
好的,尝试升级event版本看看
解决了吗我也遇到了,这是我的版本信息
Event support => enabled
Sockets support => enabled
Debug support => disabled
Extra functionality support including HTTP, DNS, and RPC => enabled
OpenSSL support => enabled
Thread safety support => disabled
Extension version => 3.0.8
libevent2 headers version => 2.1.8-stable
event重新安装新的版本就没有报warning了