You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2016/09/14 15:17:14 UTC

qpid-python git commit: QPID-7429 [Python Client 0-8..0-91] Prevent Client from leaking threads when connection is closed remotely

Repository: qpid-python
Updated Branches:
  refs/heads/master bc3605bc8 -> 81f09ae33


QPID-7429 [Python Client 0-8..0-91] Prevent Client from leaking threads when connection is closed remotely


Project: http://git-wip-us.apache.org/repos/asf/qpid-python/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-python/commit/81f09ae3
Tree: http://git-wip-us.apache.org/repos/asf/qpid-python/tree/81f09ae3
Diff: http://git-wip-us.apache.org/repos/asf/qpid-python/diff/81f09ae3

Branch: refs/heads/master
Commit: 81f09ae33839b7048a08bdf5b7405d64a1446b27
Parents: bc3605b
Author: Alex Rudyy <or...@apache.org>
Authored: Wed Sep 14 16:13:08 2016 +0100
Committer: Alex Rudyy <or...@apache.org>
Committed: Wed Sep 14 16:13:08 2016 +0100

----------------------------------------------------------------------
 qpid/peer.py  | 7 ++++---
 qpid/queue.py | 3 ++-
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-python/blob/81f09ae3/qpid/peer.py
----------------------------------------------------------------------
diff --git a/qpid/peer.py b/qpid/peer.py
index 3025c2e..2ff25c0 100644
--- a/qpid/peer.py
+++ b/qpid/peer.py
@@ -105,7 +105,7 @@ class Peer:
         try:
           frame = self.conn.read()
         except EOF, e:
-          self.work.close()
+          self.work.close("Connection lost")
           break
         ch = self.channel(frame.channel)
         ch.receive(frame, self.work)
@@ -121,6 +121,7 @@ class Peer:
     self.delegate.closed(reason)
     for ch in self.channels.values():
       ch.closed(reason)
+    self.outgoing.close()
 
   def writer(self):
     try:
@@ -149,8 +150,8 @@ class Peer:
           content = None
 
         self.delegate(channel, Message(channel, frame, content))
-    except QueueClosed:
-      self.closed("worker closed")
+    except QueueClosed, e:
+      self.closed(str(e) or "worker closed")
     except:
       self.fatal()
 

http://git-wip-us.apache.org/repos/asf/qpid-python/blob/81f09ae3/qpid/queue.py
----------------------------------------------------------------------
diff --git a/qpid/queue.py b/qpid/queue.py
index 63a7684..100bb0b 100644
--- a/qpid/queue.py
+++ b/qpid/queue.py
@@ -40,7 +40,8 @@ class Queue(BaseQueue):
     self.thread = None
 
   def close(self, error = None):
-    self.error = error
+    if error and self.error is None:
+      self.error = error
     self.put(Queue.END)
     if self.thread is not None:
       self.thread.join()


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org