From 2fa546d16691e9c9b54d36b7861baa1be00aecc7 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Wed, 30 Oct 2013 10:08:56 +0000 Subject: QPID-5203: if session error exists, simply return from session close (also reverts previous fix) git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1537030 13f79535-47bb-0310-9956-ffa450edef68 --- python/qpid/messaging/endpoints.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'python') diff --git a/python/qpid/messaging/endpoints.py b/python/qpid/messaging/endpoints.py index 7cd3931465..e69d7a10ae 100644 --- a/python/qpid/messaging/endpoints.py +++ b/python/qpid/messaging/endpoints.py @@ -750,7 +750,7 @@ class Session(Endpoint): """ Close the session. """ - self.error = None + if self.error: return self.sync(timeout=timeout) for link in self.receivers + self.senders: @@ -921,9 +921,8 @@ class Sender(Endpoint): self._wakeup() try: - if not self.session.closed: - if not self.session._ewait(lambda: self.closed, timeout=timeout): - raise Timeout("sender close timed out") + if not self.session._ewait(lambda: self.closed, timeout=timeout): + raise Timeout("sender close timed out") finally: try: self.session.senders.remove(self) @@ -1069,9 +1068,8 @@ class Receiver(Endpoint, object): self._wakeup() try: - if not self.session.closed: - if not self.session._ewait(lambda: self.closed, timeout=timeout): - raise Timeout("receiver close timed out") + if not self.session._ewait(lambda: self.closed, timeout=timeout): + raise Timeout("receiver close timed out") finally: try: self.session.receivers.remove(self) -- cgit v1.2.1