~cjwatson/python-oops-amqp/publisher-handle-channel-errors

  • Committer: Colin Watson
  • Date: 2019-05-22 08:56:20 UTC
  • Revision ID: cjwatson@canonical.com-20190522085620-hqfvlx9uczu8n9oj
Handle AMQP channel errors (particularly NotFound) in the publisher.

amqp 2.4.0 included a change to drain events before publishing.  This
means that if we try to publish an OOPS to a nonexistent exchange, then
some future publishing attempt will raise a NotFound exception, which is
a channel error rather than a connection error and so wasn't previously
handled.

To try to minimise confusion resulting from this (which can be
considerable - it took me several days to track down what was happening
in Launchpad's test suite), spend a short time waiting for a response
for the broker after publishing an OOPS.  This will typically allow us
to detect channel errors immediately, which we now handle; even if we
don't manage to handle them immediately, they'll be handled the next
time we try to publish something on the same channel.

It would be possible to handle channel errors more economically by just
reopening a channel on the same connection rather than reopening the
entire connection, but reopening the connection seems to work well
enough for now.
Filename Latest Rev Last Changed Committer Comment Size
..
oops_amqp 1 12 years ago Robert Collins Initial creation. Diff
.bzrignore 21.1.3 6 years ago Colin Watson Add Python 3 support. 148 bytes Diff Download File
.testr.conf 7.1.1 12 years ago Robert Collins Add a .testr.conf. 163 bytes Diff Download File
File bootstrap.py 1 12 years ago Robert Collins Initial creation. 9.7 KB Diff Download File
buildout.cfg 7 12 years ago Robert Collins Relicense LGPL per silbs. 1 KB Diff Download File
LICENSE 7 12 years ago Robert Collins Relicense LGPL per silbs. 7.4 KB Diff Download File
Makefile 12 11 years ago Robert Collins Add Makefile for convenient developer setup. 295 bytes Diff Download File
MANIFEST.in 1 12 years ago Robert Collins Initial creation. Empty Diff Download File
NEWS 24 4 years ago Colin Watson Handle AMQP channel errors (particularly NotFound) 2.6 KB Diff Download File
README 21.1.2 6 years ago Colin Watson Port from amqplib to amqp. amqplib seems to be un 4.9 KB Diff Download File
File setup.py 23 5 years ago Colin Watson Release 0.1.0. 2 KB Diff Download File
versions.cfg 21.1.3 6 years ago Colin Watson Add Python 3 support. 364 bytes Diff Download File