Impossible to reopen closed channel
Bug #969229 reported by
Jurdanas Kriauciunas
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.
Changed in txamqp: | |
status: | New → Fix Released |
To post a comment you must log in.
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: queue_delete( queue=" chatrooms" ) # here the 404 happens channel( 1) # here the channel is recreated just because it is already removed from the dict channel_ open()
yield self.chan.
except Exception,ex:
print "Error deleting queue %s, ignored" % ex
self.chan = yield self.conn.
yield self.chan.