Skip to content

easyswoole 3.5.1 执行 php easyswoole process show -d 会报“除法”错误 #535

@645263

Description

@645263
php easyswoole process show -d

软件信息:
swoole版本 4.6.7
es 版本 3.5.1
PHP 版本 7.4.24

发现问题的场景:
使用自定义进程,并且使用了php-amqplib/php-amqplib 组件,才会出现这个问题
php-amqplib/php-amqplib:3.1.2
自定义进程代码如下:

<?php
namespace App\Process\RabbitMqConsumer;
use EasySwoole\Component\Process\AbstractProcess;
use PhpAmqpLib\Connection\AMQPStreamConnection;
class Test extends AbstractProcess
{
    protected function run($arg)
    {
        go(function (){
            $queueName  = 'WORK_QUEUE';
            $config     = \EasySwoole\EasySwoole\Config::getInstance()->getConf("rabbitmq");
            $connection = new AMQPStreamConnection($config['host'], $config['port'], $config['user'], $config['password']);
            $channel    = $connection->channel();
            $channel->queue_declare($queueName, false, true, false, false);
            $callback = function ($msg) use ($channel){
            };
            $channel->basic_qos(null, 1, null);
            $channel->basic_consume($queueName, '', false, false, false, false, $callback);
            while (count($channel->callbacks)) {
                $channel->wait();
            }
            $channel->close();
            $connection->close();
        });
    }
}

php easyswoole process show -d
[2022-03-20 23:50:54][trigger][warning]:[Division by zero at file:/Users/pengxingjiang/Documents/wwwroot/www/zhenqin/api-server/vendor/easyswoole/easyswoole/src/Command/DefaultCommand/Process.php line:118]
[2022-03-20 23:50:54][trigger][warning]:[Division by zero at file:/Users/pengxingjiang/Documents/wwwroot/www/zhenqin/api-server/vendor/easyswoole/easyswoole/src/Command/DefaultCommand/Process.php line:119]
┌───────┬─────────────────────────────────────────┬───────────────────────────────────────┬─────────────┬─────────────────┬─────────────────────┬──────────────────────────────────┐
│ pid │ name │ group │ memoryUsage │ memoryPeakUsage │ startUpTime │ hash │
├───────┼─────────────────────────────────────────┼───────────────────────────────────────┼─────────────┼─────────────────┼─────────────────────┼──────────────────────────────────┤
│ 74436 │ RabbitMqLogConsumerProcess │ ZqHuaHuiShopProcess │ NAN b │ NAN b │ 2022-03-20 23:50:41 │ 000000002eda0171000000005df7d1d0 │
│ 74420 │ EasySwooleZhenQinApiServer.Worker.0 │ EasySwooleZhenQinApiServer.Worker │ 4.62 mb │ 6 mb │ 2022-03-20 23:50:40 │ │
│ 74421 │ EasySwooleZhenQinApiServer.Worker.1 │ EasySwooleZhenQinApiServer.Worker │ 3.14 mb │ 4 mb │ 2022-03-20 23:50:40 │ │
│ 74422 │ EasySwooleZhenQinApiServer.Worker.2 │ EasySwooleZhenQinApiServer.Worker │ 3.14 mb │ 4 mb │ 2022-03-20 23:50:40 │ │
│ 74423 │ EasySwooleZhenQinApiServer.Worker.3 │ EasySwooleZhenQinApiServer.Worker │ 3.14 mb │ 4 mb │ 2022-03-20 23:50:40 │ │
│ 74424 │ EasySwooleZhenQinApiServer.Worker.4 │ EasySwooleZhenQinApiServer.Worker │ 3.14 mb │ 4 mb │ 2022-03-20 23:50:40 │ │
│ 74425 │ EasySwooleZhenQinApiServer.Worker.5 │ EasySwooleZhenQinApiServer.Worker │ 3.14 mb │ 4 mb │ 2022-03-20 23:50:40 │ │
│ 74426 │ EasySwooleZhenQinApiServer.Worker.6 │ EasySwooleZhenQinApiServer.Worker │ 3.14 mb │ 4 mb │ 2022-03-20 23:50:40 │ │
│ 74427 │ EasySwooleZhenQinApiServer.Worker.7 │ EasySwooleZhenQinApiServer.Worker │ 3.14 mb │ 4 mb │ 2022-03-20 23:50:40 │ │
│ 74432 │ EasySwooleZhenQinApiServer.TaskWorker.0 │ EasySwooleZhenQinApiServer.TaskWorker │ 3.15 mb │ 4 mb │ 2022-03-20 23:50:41 │ 000000002eda0101000000005df7d1d0 │
│ 74433 │ EasySwooleZhenQinApiServer.TaskWorker.1 │ EasySwooleZhenQinApiServer.TaskWorker │ 3.15 mb │ 4 mb │ 2022-03-20 23:50:41 │ 000000002eda0102000000005df7d1d0 │
│ 74434 │ EasySwooleZhenQinApiServer.TaskWorker.2 │ EasySwooleZhenQinApiServer.TaskWorker │ 3.15 mb │ 4 mb │ 2022-03-20 23:50:41 │ 000000002eda010f000000005df7d1d0 │
│ 74435 │ EasySwooleZhenQinApiServer.TaskWorker.3 │ EasySwooleZhenQinApiServer.TaskWorker │ 3.15 mb │ 4 mb │ 2022-03-20 23:50:41 │ 000000002eda0108000000005df7d1d0 │
│ 74437 │ EasySwooleZhenQinApiServer.Bridge │ EasySwooleZhenQinApiServer.Bridge │ 3.16 mb │ 4 mb │ 2022-03-20 23:50:41 │ 000000002eda0130000000005df7d1d0 │
│ 74428 │ EasySwoole.SyncInvoker.Worker.0 │ │ 3.15 mb │ 4 mb │ 2022-03-20 23:50:41 │ 000000002eda0160000000005df7d1d0 │
│ 74429 │ EasySwoole.SyncInvoker.Worker.1 │ │ 3.15 mb │ 4 mb │ 2022-03-20 23:50:40 │ 000000002eda016d000000005df7d1d0 │
│ 74430 │ EasySwoole.SyncInvoker.Worker.2 │ │ 3.15 mb │ 4 mb │ 2022-03-20 23:50:41 │ 000000002eda016e000000005df7d1d0 │
│ 74431 │ HotReload │ │ 3.14 mb │ 4 mb │ 2022-03-20 23:50:41 │ 000000002eda0117000000005df7d1d0 │
└───────┴─────────────────────────────────────────┴───────────────────────────────────────┴─────────────┴─────────────────┴─────────────────────┴──────────────────────────────────┘

mac 电脑会出现这个错误。linux服务器也会出现这个错误

希望官方解决一下这个问题,感谢

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions