[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Improve some log messages



Update of /home/minion/cvsroot/src/minion/lib/mixminion/server
In directory moria.mit.edu:/tmp/cvs-serv19918/lib/mixminion/server

Modified Files:
	MMTPServer.py ServerQueue.py 
Log Message:
Improve some log messages

Index: MMTPServer.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/MMTPServer.py,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- MMTPServer.py	30 May 2003 04:58:42 -0000	1.31
+++ MMTPServer.py	31 May 2003 12:52:55 -0000	1.32
@@ -246,6 +246,7 @@
     #           writing.
     #    __servermode: If true, we're the server side of the connection.
     #           Else, we're the client side.
+    # DOCDOC __connecting
     def __init__(self, sock, tls, serverMode, address=None):
         """Create a new SimpleTLSConnection.
 
@@ -260,8 +261,10 @@
         self.__serverMode = serverMode
 
         if serverMode:
+            self.__connecting = 0
             self.__state = self.__acceptFn
         else:
+            self.__connecting = 1
             self.__state = self.__connectFn
 
         if address is not None:
@@ -319,6 +322,7 @@
         """Hook to implement client-side handshake."""
         self.__con.connect() #may throw want*
         self.__server.unregister(self)
+        self.__connecting = 0
         self.finished()
 
     def __shutdownFn(self):
@@ -444,11 +448,10 @@
         except _ml.TLSWantRead:
             self.__server.registerReader(self)
         except _ml.TLSClosed:
-            if self.__state is self.__connectFn:
+            if self.__connecting:
                 warn("Couldn't connect to server %s", self.address)
             else:
-                warn("Unexpectedly closed connection to %s; state is %s",
-                     self.address, self.__state)
+                warn("Unexpectedly closed connection to %s", self.address)
             self.handleFail(retriable=1)
             self.__sock.close()
             self.__server.unregister(self)

Index: ServerQueue.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/ServerQueue.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- ServerQueue.py	30 May 2003 04:58:42 -0000	1.17
+++ ServerQueue.py	31 May 2003 12:52:55 -0000	1.18
@@ -595,21 +595,21 @@
             handles = self.sendable
             messages = []
             self.sendable = []
+            for h in self.pending.keys():
+                LOG.trace("     [%s] is pending delivery", h)
             for h in handles:
                 assert not self.pending.has_key(h)
                 next = self.nextAttempt[h]
                 if next is None:
-                    LOG.trace("     [%s] is expired.", h)
+                    LOG.trace("     [%s] is expired", h)
                     self.removeMessage(h)
                 elif next <= now:
                     LOG.trace("     [%s] is ready for delivery", h)
                     messages.append( (h, self.getObject(h)) )
                     self.pending[h] = now
                 else:
-                    LOG.trace("     [%s] is not yet ready for delivery", h)
+                    LOG.trace("     [%s] is not yet ready for redelivery", h)
                     self.sendable.append(h)
-            for h in self.pending.keys():
-                LOG.trace("     [%s] is pending delivery", h)
         finally:
             self._lock.release()
         self._repOk()