workerman stop守护进程报错

hujiao

问题描述

因异步场景需要,我使用了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

截图报错信息里报错文件相关代码

截图

操作系统及workerman/webman等框架组件具体版本

系统版本

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"
    }
}
260 1 0
1个回答

walkor 打赏

执行php --ri event
看下event版本

  • hujiao 29天前

    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

  • walkor 29天前

    试下升级event扩展

  • hujiao 29天前

    好的,尝试升级event版本看看

  • onwnic 19天前

    解决了吗我也遇到了,这是我的版本信息
    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

  • hujiao 7天前

    event重新安装新的版本就没有报warning了

×
🔝