Rev 2380: Add more debugging code to the smart server to debug pqm failures. in http://people.ubuntu.com/~robertc/baz2.0/integration

Robert Collins robertc at robertcollins.net
Tue Mar 27 05:58:03 BST 2007


At http://people.ubuntu.com/~robertc/baz2.0/integration

------------------------------------------------------------
revno: 2380
revision-id: robertc at robertcollins.net-20070327045759-hb7j634wpm1ris7l
parent: robertc at robertcollins.net-20070327043224-9ql8frcekqjbb64g
committer: Robert Collins <robertc at robertcollins.net>
branch nick: integration
timestamp: Tue 2007-03-27 14:57:59 +1000
message:
  Add more debugging code to the smart server to debug pqm failures.
modified:
  bzrlib/trace.py                trace.py-20050309040759-c8ed824bdcd4748a
  bzrlib/transport/smart.py      ssh.py-20060608202016-c25gvf1ob7ypbus6-1
=== modified file 'bzrlib/trace.py'
--- a/bzrlib/trace.py	2007-01-30 10:51:38 +0000
+++ b/bzrlib/trace.py	2007-03-27 04:57:59 +0000
@@ -181,6 +181,8 @@
 
     The exception string representation is used as the error
     summary, unless msg is given.
+
+    Please see log_exception_quietly() for the replacement API.
     """
     if msg:
         error(msg)

=== modified file 'bzrlib/transport/smart.py'
--- a/bzrlib/transport/smart.py	2007-03-27 04:21:26 +0000
+++ b/bzrlib/transport/smart.py	2007-03-27 04:57:59 +0000
@@ -853,15 +853,20 @@
         for hook in SmartTCPServer.hooks['server_started']:
             hook(self.backing_transport.base, self.get_url())
         try:
-            while not self._should_terminate:
-                try:
-                    self.accept_and_serve()
-                except socket_timeout:
-                    # just check if we're asked to stop
-                    pass
-                except socket_error, e:
-                    trace.warning("client disconnected: %s", e)
-                    pass
+            try:
+                while not self._should_terminate:
+                    try:
+                        self.accept_and_serve()
+                    except socket_timeout:
+                        # just check if we're asked to stop
+                        pass
+                    except socket_error, e:
+                        trace.warning("client disconnected: %s", e)
+                        pass
+            except Exception, e:
+                trace.error("Unhandled smart server error.")
+                trace.log_exception_quietly()
+                raise
         finally:
             try:
                 self._server_socket.close()



More information about the bazaar-commits mailing list