[Buildbot-commits] buildbot/buildbot pbutil.py,1.9,1.10

Brian Warner warner at users.sourceforge.net
Tue May 24 22:33:02 UTC 2005


Update of /cvsroot/buildbot/buildbot/buildbot
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4686/buildbot

Modified Files:
	pbutil.py 
Log Message:
Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-225
Creator:  Brian Warner <warner at monolith.lothar.com>

fix slave-reconnect on network loss

	* buildbot/pbutil.py (ReconnectingPBClientFactory): Twisted-1.3
	erroneously abandons the connection (in clientConnectionFailed)
	for non-UserErrors, which means that if we lose the connection due
	to a network problem or a timeout, we'll never try to reconnect.
	Fix this by not upcalling to the buggy parent method. Note:
	twisted-2.0 fixes this, but the function only has 3 lines so it
	makes more sense to copy it than to try and detect the buggyness
	of the parent class.


Index: pbutil.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/pbutil.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- pbutil.py	22 Apr 2005 21:29:19 -0000	1.9
+++ pbutil.py	24 May 2005 22:33:00 -0000	1.10
@@ -50,8 +50,12 @@
 
     def clientConnectionFailed(self, connector, reason):
         PBClientFactory.clientConnectionFailed(self, connector, reason)
-        RCF = protocol.ReconnectingClientFactory
-        RCF.clientConnectionFailed(self, connector, reason)
+        # Twisted-1.3 erroneously abandons the connection on non-UserErrors.
+        # To avoid this bug, don't upcall, and implement the correct version
+        # of the method here.
+        if self.continueTrying:
+            self.connector = connector
+            self.retry()
 
     def clientConnectionLost(self, connector, reason):
         PBClientFactory.clientConnectionLost(self, connector, reason,





More information about the Commits mailing list