swoft-cloud / swoft

🚀 PHP Microservice Full Coroutine Framework
https://swoft.org
Apache License 2.0
5.58k stars 786 forks source link

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 #1368

Open simpleKalvin opened 4 years ago

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

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

simpleKalvin commented 4 years ago

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

Ederth commented 4 years ago

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

simpleKalvin commented 4 years ago

我这边发现 db的pool没有得到释放 ![Uploading image.png…]()

simpleKalvin commented 4 years ago

[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 在报我的异常前会报这个

Ederth commented 4 years ago

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

shaniu00 commented 3 years ago

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

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