From f92c42ffe7662d1d0e2863c6e143567b25ae2024 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Thu, 15 Mar 2007 17:49:44 +0000 Subject: * 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 --- python/qpid/peer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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: -- cgit v1.2.1