<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><div>I'm experiencing a KeyError exception, where the key is "Tx.SelectOk" when using Pika 0.9.5.</div><div><br></div><div>The scenario: A simple program that simply writes two messages a second to a queue. While this test is running, I stop the broker, then restart it a few seconds later. I explicitly check for AMQPConnectionError exceptions, and if seen reconnect to the broker. About half the time, the test works as intended. However, other times I see the KeyError exception, which my guess is not what's intended.</div><div><br></div><div>My writing code looks like this:</div><div><div><div> try:</div><div> channel = self._channel</div><div> channel.tx_select()</div><div> channel.basic_publish(exchange='',</div><div> routing_key=queue_name,</div><div> body=json_string,</div><div> properties=pika.BasicProperties(delivery_mode=2))</div><div> channel.tx_commit()</div><div> return</div><div> except AMQPConnectionError as e:</div><div> self._reconnect()</div></div></div><div><br></div><div>Digging into the traceback data, the faulting line is in Pika's blocking_connection.py:rpc()</div><div><br></div><div><div> # Find our reply in our list of replies</div><div> for reply in self._replies:</div><div> if reply in replies:</div><div><b><u> frame = self._frames[reply] # THIS HERE IS THE LINE</u></b></div><div> self._received_response = True</div><div> if callback:</div><div> callback(frame)</div><div> del(self._frames[reply])</div><div> return frame</div></div><div><br></div><div>Known issue? Expected and acceptable? Thoughts?</div><div><br></div><div>Thanks,</div><div><br></div><div>Matt</div></body></html>