swoft icon indicating copy to clipboard operation
swoft copied to clipboard

PHP Fatal error: Swoole\Coroutine\Channel::isEmpty(): you must call Channel constructor first in /var/www/swoft/vendor/swoft/connection-pool/src/AbstractPool.php on line 198 [2020-09-18 13:48:53 @158.0] WARNING ~Channel (ERRNO 10003): channel is destroyed, 3 consumers will be discarded

Open simpleKalvin opened this issue 5 years ago • 7 comments

  1. 在用户进程持续消费mq
  2. 用户进程触发一次 就启动三个协程消费 code: image

simpleKalvin avatar Sep 18 '20 06:09 simpleKalvin

应该是连接池的配置有问题,建议先在http控制器里面试一下简单的publish,排查一下

Ederth avatar Sep 18 '20 09:09 Ederth

你好,会不会是这个amqp的数量池被用完了?因为我这边放进去300条,前200都没问题,跑着跑着就会出这个报错,而且一定要固定跑一定时间就会有

simpleKalvin avatar Sep 18 '20 09:09 simpleKalvin

你可以理一下连接释放,可能是连接没有释放回连接池

Ederth avatar Sep 18 '20 11:09 Ederth

我这边发现 db的pool没有得到释放 Uploading image.png…

simpleKalvin avatar Sep 22 '20 07:09 simpleKalvin

[INFO] App\Console\Command\DemoCommand:App\Console\Command{closure}(176) Pool error is Channel pop timeout by 0.000000s file=/var/www/swoft/vendor/swoft/connection-pool/src/AbstractPool.php line=237 在报我的异常前会报这个

simpleKalvin avatar Sep 22 '20 07:09 simpleKalvin

你的图好像挂了,db是监听事件以及在事务回滚等情况释放连接 如果是自己写的amqp连接池,可以参照这redis,db两个组件的写法释放连接

Ederth avatar Sep 23 '20 11:09 Ederth

请问问题解决了吗 我也是报相同的错误 我是脚本里面报的 redis配置如下

 'redis.default.pool' => [
            'class' => RedisPool::class,
            'redisDb' => \bean('redis.default'),
            'minActive' => 10,
            'maxActive' => 20,
            'maxWait' => 0,
            'maxWaitTime' => 0,
            'maxIdleTime' => 60,
        ],

shaniu00 avatar Feb 18 '21 02:02 shaniu00