<div>
                    IIRC channels in _channels are not removed until Channel.CloseOk is received from Rabbit, even if you asked for a Channel.Close.
                </div>
                 
                  
                <p style="color: #A0A0A8;">On Friday, June 29, 2012 at 3:01 PM, Ask Solem wrote:</p><blockquote type="cite"><div>
                    <span><div><div><div><br></div><div>On 18 Jun 2012, at 11:49, Darren wrote:</div><div><br></div><blockquote type="cite"><div><div><br></div><div>Not sure if this is user error or not, but I am opening a blocking connection:</div><div><br></div><div>        self.credentials = pika.PlainCredentials(settings.BROKER_USERNAME, settings.BROKER_PASSWORD)</div><div>        self.connection = pika.BlockingConnection(pika.ConnectionParameters(host=settings.BROKER_HOSTNAME, port=settings.BROKER_PORT, credentials=self.credentials))</div><div>        self.channel = self.connection.channel()</div><div>        self.callback_queue = self.channel.queue_declare().method.queue</div><div><br></div><div>and I try to close it like this:</div><div>        self.channel.queue_delete(queue=self.callback_queue)</div><div>        self.connection.close()</div><div><br></div><div>However, as seen from Rabbit MQ management console, the connection.close() method deletes the channels, but NOT the connection?</div><div>Now, the close method calls: BaseConnection.close(self, code, text)</div><div>which calls:</div><div>        for channel_number in self._channels.keys():</div><div>            self._channels[channel_number].close(code, text) # this closes the channel</div><div><br></div><div>        # If we already dont have any channels, close out</div><div>        if not self._channels:</div><div>            self._on_close_ready() # never gets here?</div><div><br></div><div>If instead, I have:</div><div>        self.connection.close()</div><div>        self.connection._on_close_ready()</div><div><br></div><div>then everything shuts down ok?</div></div></blockquote><div><br></div><div>If there are still channels in _channels after that closing loop</div><div>ends then I'm inclined to think this is a bug in pika.</div><div>Maybe you should open up an issue here:</div><div><a href="https://github.com/pika/pika/issues">https://github.com/pika/pika/issues</a></div><div>_______________________________________________</div><div>rabbitmq-discuss mailing list</div><div><a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a></div><div><a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a></div></div></div></span>
                  
                  
                  
                  
                </div></blockquote><div>
                    <br>
                </div>