[Swift-commit] cog r3782

swift at ci.uchicago.edu swift at ci.uchicago.edu
Sun Sep 15 21:35:02 CDT 2013


------------------------------------------------------------------------
r3782 | hategan | 2013-09-15 21:33:23 -0500 (Sun, 15 Sep 2013) | 1 line

Skip proxies that fail to load (might be concurrency issue) and fix shared proxy condition (was reversed)
------------------------------------------------------------------------
Index: modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/AutoCA.java
===================================================================
--- modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/AutoCA.java	(revision 3781)
+++ modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/AutoCA.java	(working copy)
@@ -138,24 +138,29 @@
                 if (logger.isInfoEnabled()) {
                     logger.info("Checking certificate " + c);
                 }
-                X509Certificate cert = CertUtil.loadCertificate(c.getAbsolutePath());
-                long certExpirationTime = cert.getNotAfter().getTime();
-                if (certExpirationTime < now) {
-                    // delete cert and key
-                    if (logger.isInfoEnabled()) {
-                        logger.info("Certificate expired. Deleting.");
+                try {
+                    X509Certificate cert = CertUtil.loadCertificate(c.getAbsolutePath());
+                    long certExpirationTime = cert.getNotAfter().getTime();
+                    if (certExpirationTime < now) {
+                        // delete cert and key
+                        if (logger.isInfoEnabled()) {
+                            logger.info("Certificate expired. Deleting.");
+                        }
+                        deleteAll(getIndex(c));
                     }
-                    deleteAll(getIndex(c));
+                    if (certExpirationTime > maxExpirationTime) {
+                        maxExpirationTime = certExpirationTime;
+                        int index = getIndex(c);
+                        this.info = new Info(makeFile(PROXY_NAME_PREFIX, index), makeFile(CA_CRT_NAME_PREFIX, index));
+                        this.cert = cert;
+                    }
                 }
-                if (certExpirationTime > maxExpirationTime) {
-                    maxExpirationTime = certExpirationTime;
-                    int index = getIndex(c);
-                    this.info = new Info(makeFile(PROXY_NAME_PREFIX, index), makeFile(CA_CRT_NAME_PREFIX, index));
-                    this.cert = cert;
+                catch (Exception e) {
+                    logger.info("Failed to check " + c + ". Ignoring.", e);
                 }
             }
             
-            if (now + MIN_CA_CERT_LIFETIME_LEFT > maxExpirationTime && SHARED_PROXIES) {
+            if (now + MIN_CA_CERT_LIFETIME_LEFT > maxExpirationTime || !SHARED_PROXIES) {
                 int index = discoverNextIndex();
                 this.info = new Info(makeFile(PROXY_NAME_PREFIX, index), makeFile(CA_CRT_NAME_PREFIX, index));
                 if (logger.isInfoEnabled()) {



More information about the Swift-commit mailing list