Impossible to reopen closed channel

Bug #969229 reported by Jurdanas Kriauciunas
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
txAMQP
Fix Released
Undecided
Unassigned

Bug Description

Hi,

AMQClient.channels dict stores all opened channels. But if error occurs channel is closed, AMQChannel.closed variable updated but AMQPClient.channels dict is not updated.
I have done a small patch: AMQClient.channel() function checks not only if channel exists but also checks 'closed' variable. And recreates channel if needed.

Revision history for this message
Jurdanas Kriauciunas (jurdanas-kriauciunas) wrote :
description: updated
Revision history for this message
Vsevolod Novikov (nnseva) wrote :

It is possible and useful to remove the channel from the client dict immediately when the channel is closed, using appropriate event. The applied patch does it such a way, that the code like the following works correctly:

    try:
        yield self.chan.queue_delete(queue="chatrooms") # here the 404 happens
    except Exception,ex:
        print "Error deleting queue %s, ignored" % ex
        self.chan = yield self.conn.channel(1) # here the channel is recreated just because it is already removed from the dict
        yield self.chan.channel_open()

Changed in txamqp:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.