Environment
AWS EC2 small instances, running amazon linux and php 7.1.
RabbitMQ installed locally.
RabbitMQ as well as sonata notifications are set up to auto restart should they go down via supervisor.
Sonata packages
$ composer show --latest 'sonata-project/*'
`sonata-project/admin-bundle 3.31.0 The missing Symfony Admin Generator
sonata-project/block-bundle 3.11.0 Symfony SonataBlockBundle
sonata-project/cache 2.0.1 Cache library
sonata-project/classification-bundle 3.x-dev 0f3f55f Symfony SonataClassificationBundle
sonata-project/core-bundle 3.9.0 Symfony SonataCoreBundle
sonata-project/datagrid-bundle 2.3.1 Symfony SonataDatagridBundle
sonata-project/doctrine-extensions 1.0.2 Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 3.4.1 Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/easy-extends-bundle 2.4.0 Symfony SonataEasyExtendsBundle
sonata-project/exporter 1.8.0 Lightweight Exporter library
sonata-project/notification-bundle 3.3.0 Symfony SonataNotificationBundle
sonata-project/user-bundle dev-master 7a210f8 Symfony SonataUserBundle
`
Symfony packages
$ composer show --latest 'symfony/*'
`symfony/monolog-bundle v3.1.2 Symfony MonologBundle
symfony/phpunit-bridge v3.4.3 Symfony PHPUnit Bridge
symfony/polyfill-apcu v1.6.0 Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-intl-icu v1.6.0 Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring v1.6.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php56 v1.6.0 Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70 v1.6.0 Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-util v1.6.0 Symfony utilities for portability of PHP codes
symfony/security-acl v3.0.1 Symfony Security Component - ACL (Access Control List)
symfony/swiftmailer-bundle v2.6.7 Symfony SwiftmailerBundle
symfony/symfony v3.4.3 The Symfony PHP framework
`
PHP version
$ php -v
`PHP 7.1.7 (cli) (built: Sep 14 2017 15:47:38) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.7, Copyright (c) 1999-2017, by Zend Technologies`
Subject
So since updating to version 3.3.0 of the message bundle I have that problem that it maxes out my CPU at 100% randomly.
Apparently something at the startup of a new iteration cycle goes bad causing it to cap at 100% and stay there.
Sadly it will not generate logs when it does this so I'm having a hard time pinpointing the issue.
(The log below is the only thing that was in my rotated log)
Steps to reproduce
Unknown, maybe the connection refusal causes it somehow?
Expected results
That it starts normally each time without causing the CPU to go to 100% and stay there till you kill the php process running sonata:notification:start
Actual results
[Mon, 05 Feb 2018 22:48:30 +0000] Retrieving backend ...22:48:30 ERROR [console] Error thrown while running command "sonata:notification:start --env=prod --iteration=250". Message: "stream_socket_client(): unable to connect to tcp://localhost:5672 (Connection refused)" ["error" => ErrorException { …},"command" => "sonata:notification:start --env=prod --iteration=250","message" => "stream_socket_client(): unable to connect to tcp://localhost:5672 (Connection refused)"] []
In StreamIO.php line 138:
stream_socket_client(): unable to connect to tcp://localhost:5672 (Connecti
on refused)
sonata:notification:start [-i|--iteration [ITERATION]] [--type [TYPE]] [-d|--show-details [SHOW-DETAILS]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>
I've also got a new relic transaction case of such a long running action:
Custom Enqueue\AmqpLib\AmqpConsumer::receiveBasicGet 230 989,000 ms 77%
Custom Enqueue\AmqpLib\AmqpConsumer::receive 230 283,000 ms 22%
Custom Sonata\NotificationBundle\Iterator\AMQPMessageIterator::next 230 6,350 ms 0%
Custom PhpAmqpLib\Wire\IO\StreamIO::select 125 5,380 ms 0%
Custom Sonata\NotificationBundle\Command\ConsumerHandlerCommand::execute 1 1,330 ms 0%
Custom PhpAmqpLib\Channel\AbstractChannel::wait 132 181 ms 0%
Total time 1,280,000 ms 100%
bug unconfirmed