You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2006/09/25 19:33:27 UTC
svn commit: r449750 - in /incubator/qpid/trunk/qpid/python/qpid: message.py
peer.py
Author: aconway
Date: Mon Sep 25 10:33:26 2006
New Revision: 449750
URL: http://svn.apache.org/viewvc?view=rev&rev=449750
Log:
Close channels on fatal errors to prevent hangs, provide useful stack trace.
Modified:
incubator/qpid/trunk/qpid/python/qpid/message.py
incubator/qpid/trunk/qpid/python/qpid/peer.py
Modified: incubator/qpid/trunk/qpid/python/qpid/message.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/qpid/message.py?view=diff&rev=449750&r1=449749&r2=449750
==============================================================================
--- incubator/qpid/trunk/qpid/python/qpid/message.py (original)
+++ incubator/qpid/trunk/qpid/python/qpid/message.py Mon Sep 25 10:33:26 2006
@@ -26,7 +26,7 @@
def __len__(self):
l = len(self.fields)
- if method.content:
+ if self.method.content:
l += 1
return len(self.fields)
Modified: incubator/qpid/trunk/qpid/python/qpid/peer.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/qpid/peer.py?view=diff&rev=449750&r1=449749&r2=449750
==============================================================================
--- incubator/qpid/trunk/qpid/python/qpid/peer.py (original)
+++ incubator/qpid/trunk/qpid/python/qpid/peer.py Mon Sep 25 10:33:26 2006
@@ -57,13 +57,10 @@
thread.start_new_thread(self.reader, ())
thread.start_new_thread(self.worker, ())
- def fatal(message=None):
- """Call when an unexpected exception occurs that will kill a thread.
-
- In this case it's better to crash the process than to continue in
- an invalid state with a missing thread."""
+ def fatal(self, message=None):
+ """Call when an unexpected exception occurs that will kill a thread."""
if message: print >> sys.stderr, message
- traceback.print_exc()
+ self.close("Fatal error: %s\n%s" % (message or "", traceback.format_exc()))
def reader(self):
try: