|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65868 AMQPQueue declare should not close the channel when the queue does not exist
Submitted: 2013-10-09 06:19 UTC Modified: -
From: ruslan dot talpa at gmail dot com Assigned:
Status: Open Package: amqp (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2013-10-09 06:19 UTC] ruslan dot talpa at gmail dot com
If you try to connect to a queue with the AMQP_PASSIVE flag (you do not want to declare the queue if it does not exist) the declare method will throw an error and "close" the channel (amqp_queue.c line 711)
In this particular case (queue does not exist), i am not sure the channel should be closed.

The things are made worse by the fact that AMQPChannel does not have a close() method so you can't "clean up"

This is a problem because in a "worker" where you are processing messages, your communication channel get's closed and you can't reconnect the channel or create a new one (because eventually you run out of available channels)

a) don't close the channel when queue does not exist
b) implement a close() method for channel
c) implement a reconnect() method for channel if it's just the "is_connected" is set to 0 but the channel is actually alive

Test script:

Expected result:
Channels get disconnected and eventually you can't create any more channels


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun May 09 23:01:26 2021 UTC