summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-03-15 17:49:44 +0000
committerAlan Conway <aconway@apache.org>2007-03-15 17:49:44 +0000
commitf92c42ffe7662d1d0e2863c6e143567b25ae2024 (patch)
treee834e09cbc53cc6767a8edc415816b345b82b1ba
parent06f06eb902f4d2b07fde2328fc5b3a98eb218d66 (diff)
downloadqpid-python-f92c42ffe7662d1d0e2863c6e143567b25ae2024.tar.gz
* python/qpid/peer.py (Peer.close): Close delegate *before* channels.
Otherwise we get a race: closing a channel can wake a client thread, which may see client.closed as still false. Was causing bogus exceptions in some tests. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@518707 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--python/qpid/peer.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/qpid/peer.py b/python/qpid/peer.py
index b6b528f12c..888ec7b133 100644
--- a/python/qpid/peer.py
+++ b/python/qpid/peer.py
@@ -97,9 +97,12 @@ class Peer:
self.fatal()
def close(self, reason):
+ # We must close the delegate first because closing channels
+ # may wake up waiting threads and we don't want them to see
+ # the delegate as open.
+ self.delegate.close(reason)
for ch in self.channels.values():
ch.close(reason)
- self.delegate.close(reason)
def writer(self):
try: