gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sander Temme <san...@temme.net>
Subject [PATCH] Give mvnproxy time to start
Date Sat, 26 Apr 2008 06:50:23 GMT
Gang,

Since last weekend, Clarus has been running with the following patch:

===================================================================
--- python/gump/actor/mvnrepoproxy/proxycontrol.py	(revision 651761)
+++ python/gump/actor/mvnrepoproxy/proxycontrol.py	(working copy)
@@ -74,6 +74,16 @@
              # TODO emulate spawnlp on non-Unix platforms
              os.spawnlp(os.P_NOWAIT, self.java, self.java, '-jar',  
proxyJar,
                         self.workspace.mvnRepoProxyPort)
+            # Hang back for a bit while the proxy starts up
+            for pWait in range(10):
+                try:
+                    urllib.urlopen(self.proxyURL)
+                    # Not reached until urlopen succeeds
+                    log.info('mvn Repository proxy started')
+                    break
+                except IOError:
+                    time.sleep(1)
+                    continue
          except:
              log.error('--- Failed to start proxy', exc_info=1)

This causes the script to block for up to ten seconds or so after  
starting the Maven repository proxy, until it can connect to the proxy  
and fetch the index page.

Without this, the first few uploads would get 'Connection Refused' and  
I assume this would cause Bad Things  like missing artifacts down the  
road.

I would commit this but it seems that I don't have commit on the code.

S.

-- 
sander@temme.net              http://www.temme.net/sander/
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF

Mime
View raw message