Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When closing a connection from the RabbitMQ management page an exception is thrown. #14

Open
DannyvdSluijs opened this issue Feb 22, 2018 · 3 comments

Comments

@DannyvdSluijs
Copy link
Contributor

DannyvdSluijs commented Feb 22, 2018

Description

Whenever the RabbitMQ is closing connections (due to restart/upgrade etc) a PhpAmqpLib\Exception\AMQPProtocolConnectionException is thrown.

Steps to reproduce

  1. Have a running consumer (see https://github.com/DannyvdSluijs/rabbitmq-app)
  2. Open the RabbitMQ management interface (http://localhost:15672)
  3. From the connections tab close the connection
  4. The consumer wil halt and show a stack trace

Stack trace

======================================================================
   The application has thrown an exception!
======================================================================
 PhpAmqpLib\Exception\AMQPProtocolConnectionException
 CONNECTION_FORCED - Closed via management plugin
----------------------------------------------------------------------
/var/www/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Connection/AbstractConnection.php:689
#0 [internal function]: PhpAmqpLib\Connection\AbstractConnection->connection_close(Object(PhpAmqpLib\Wire\AMQPReader))
#1 /var/www/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Channel/AbstractChannel.php(207): call_user_func(Array, Object(PhpAmqpLib\Wire\AMQPReader))
#2 /var/www/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Channel/AbstractChannel.php(348): PhpAmqpLib\Channel\AbstractChannel->dispatch('10,50', '\x01@0CONNECTION_F...', NULL)
#3 /var/www/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Connection/AbstractConnection.php(614): PhpAmqpLib\Channel\AbstractChannel->wait()
#4 /var/www/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Channel/AbstractChannel.php(225): PhpAmqpLib\Connection\AbstractConnection->wait_channel(1, NULL)
#5 /var/www/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Channel/AbstractChannel.php(335): PhpAmqpLib\Channel\AbstractChannel->next_frame(NULL)
#6 /var/www/vendor/thomasvargiu/rabbitmq-module/src/Consumer.php(29): PhpAmqpLib\Channel\AbstractChannel->wait(NULL, false, NULL)
#7 /var/www/vendor/thomasvargiu/rabbitmq-module/src/Controller/ConsumerController.php(61): RabbitMqModule\Consumer->consume()
#8 /var/www/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78): RabbitMqModule\Controller\ConsumerController->indexAction()
#9 /var/www/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#10 /var/www/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#11 /var/www/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(105): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#12 /var/www/vendor/zendframework/zend-mvc-console/src/Controller/AbstractConsoleController.php(56): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Console\Request), Object(Zend\Console\Response))
#13 /var/www/vendor/zendframework/zend-mvc/src/DispatchListener.php(119): Zend\Mvc\Console\Controller\AbstractConsoleController->dispatch(Object(Zend\Console\Request), Object(Zend\Console\Response))
#14 /var/www/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#15 /var/www/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#16 /var/www/vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#17 /var/www/public/index.php(41): Zend\Mvc\Application->run()
#18 {main}

======================================================================
   Previous Exception(s):

Fatal error: Uncaught PhpAmqpLib\Exception\AMQPRuntimeException: Broken pipe or closed connection in /var/www/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Wire/IO/StreamIO.php:270
Stack trace:
#0 /var/www/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Connection/AbstractConnection.php(341): PhpAmqpLib\Wire\IO\StreamIO->write('\x01\x00\x01\x00\x00\x00\v\x00\x14\x00(\x00\x00\x00\x00...')
#1 /var/www/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Connection/AbstractConnection.php(462): PhpAmqpLib\Connection\AbstractConnection->write('\x01\x00\x01\x00\x00\x00\v\x00\x14\x00(\x00\x00\x00\x00...')
#2 /var/www/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Channel/AbstractChannel.php(238): PhpAmqpLib\Connection\AbstractConnection->send_channel_method_frame(1, Array, Object(PhpAmqpLib\Wire\AMQPWriter))
#3 /var/www/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Channel/AMQPChannel.php(167): PhpAmqpLib\Channel\AbstractChannel->send_method_frame(Array, Object(PhpAmqpLib\Wire\AMQPWriter))
#4 /var/www/vendor/thomasvargiu/rabbitmq-module/src/BaseAmqp.php(268) in /var/www/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Wire/IO/StreamIO.php on line 270
rabbitmqapp_php_1 exited with code 1
@thomasvargiu
Copy link
Owner

@DannyvdSluijs it's normal. An unxpected closed connection is an exception. Probably what you mean is that it's not possibile to handle connection exception, right?

@DannyvdSluijs
Copy link
Contributor Author

DannyvdSluijs commented May 19, 2018

Hi @thomasvargiu yes indeed there is no way to handle connection exceptions. I can see my report doesn't make that clear.

@thomasvargiu
Copy link
Owner

@DannyvdSluijs sorry, I was really busy. If you want you can help me proposing a solution. I 've took a look but it's quite complicated to do changes on the actual architecture without BC breaks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants