summaryrefslogtreecommitdiff
path: root/amqp/connection.py
diff options
context:
space:
mode:
authorMatus Valo <matusvalo@gmail.com>2019-06-12 07:28:53 +0000
committerMatus Valo <matusvalo@gmail.com>2019-06-12 22:43:37 +0000
commit99ec59ccb263cde370f6b318b92051d213bf4280 (patch)
tree7801e67e1305f3bcd403548be54977e12b5c16d3 /amqp/connection.py
parent39e81d64667405325a55baeeb3aaa7988013b9b8 (diff)
downloadpy-amqp-connection_channel_close.tar.gz
Ignore all methods except Close and Close-OK when channel/connection is closingconnection_channel_close
Diffstat (limited to 'amqp/connection.py')
-rw-r--r--amqp/connection.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/amqp/connection.py b/amqp/connection.py
index 5af06e1..4286f24 100644
--- a/amqp/connection.py
+++ b/amqp/connection.py
@@ -162,6 +162,10 @@ class Connection(AbstractChannel):
}
_METHODS = {m.method_sig: m for m in _METHODS}
+ _ALLOWED_METHODS_WHEN_CLOSING = (
+ spec.Connection.Close, spec.Connection.CloseOk
+ )
+
connection_errors = (
ConnectionError,
socket.error,
@@ -576,10 +580,11 @@ class Connection(AbstractChannel):
wait=spec.Connection.CloseOk,
)
except (OSError, IOError, SSLError):
- self.is_closing = False
# close connection
self.collect()
raise
+ finally:
+ self.is_closing = False
def _on_close(self, reply_code, reply_text, class_id, method_id):
"""Request a connection close.