Should txamqp delete channels when closed?

Asked by reverri

With the addition of the connectionLost() method I am getting Closed() exceptions from some of my test cases. The exceptions occur because the channels are closed and then the connection is disconnected.

If a closed channel exists and closed() is called on AMQClient, txamqp will attempt to close all stored channels.

One solution is to delete a channel when it has closed. A deferred can be added to the channel protocol that gets triggered during the channels close() method. A callback can they be added to the close deferred to delete the channel from the channels dict on AMQClient.

Does this sound like a reasonable solution or is there something I am not considering?

Additionally the callback could also be used by third party developers to detect channel closures.


Question information

English Edit question
txAMQP Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
reverri (reverri) said :

Would it also be appropriate to just reset the channels dict in connectionLost()?

In one of my test environments I am getting a bunch of "Connection to the other side was lost in a non-clean fashion" errors. When I clear the channels:

def connectionLost(self, reason):
 self.channels = {}

the error goes away. However, the error is unique to a single machine.

Any thoughts?

Revision history for this message
Launchpad Janitor (janitor) said :

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Esteve Fernandez (esteve) said :

Sorry, I forgot replying to this question. I can't reproduce your problem, but I think you're right that txAMQP should clear the channels dict, I'll open a bug.


Can you help with this problem?

Provide an answer of your own, or ask reverri for more information if necessary.

To post a message you must log in.