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.

Thanks,
Dan

Question information

Language:
English Edit question
Status:
Answered
For:
txAMQP Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
reverri (reverri) said :
#1

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 = {}
 self.close(reason)

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

Any thoughts?

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

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 :
#3

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.

Thanks!

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.