airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1478077 - /airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GramProvider.java
Date Wed, 01 May 2013 16:27:13 GMT
Author: lahiru
Date: Wed May  1 16:27:07 2013
New Revision: 1478077

URL: http://svn.apache.org/r1478077
Log:
fixing job retry thing.

Modified:
    airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GramProvider.java

Modified: airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GramProvider.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GramProvider.java?rev=1478077&r1=1478076&r2=1478077&view=diff
==============================================================================
--- airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GramProvider.java
(original)
+++ airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GramProvider.java
Wed May  1 16:27:07 2013
@@ -144,17 +144,37 @@ public class GramProvider implements GFa
     public void initProperties(Map<String, String> properties) throws GFacProviderException,
GFacException {
 
     }
+
     private void checkJobStatus(JobExecutionContext jobExecutionContext, GlobusHostType host,
String gateKeeper)
-			throws JobSubmissionFault {
-		int jobStatus = listener.getStatus();
+            throws GFacProviderException {
+        int jobStatus = listener.getStatus();
+
+        if (jobStatus == GramJob.STATUS_FAILED) {
+            String errorMsg = "Job " + job.getID() + " on host " + host.getHostAddress()
+ " Job Exit Code = "
+                    + listener.getError();
+            if (listener.getError() == 24) {
+                try {
+                    job.request(gateKeeper, false, false);
+                    listener.waitFor();
+                } catch (GramException e) {
+                    log.error(e.getMessage());
+                    JobSubmissionFault error = new JobSubmissionFault(this, e, host.getHostAddress(),
+                            host.getGlobusGateKeeperEndPointArray(0), job.getRSL(), jobExecutionContext);
+                    throw error;
+                } catch (GSSException e) {
+                    log.error(e.getMessage());
+                    throw new GFacProviderException(e.getMessage(), e, jobExecutionContext);
+                } catch (InterruptedException e) {
+                    log.error(e.getMessage());
+                    throw new GFacProviderException("Thread", e, jobExecutionContext);
+                } catch (GFacException e) {
+                    JobSubmissionFault error = new JobSubmissionFault(this, new Exception(errorMsg),
"GFAC HOST", gateKeeper,
+                            job.getRSL(), jobExecutionContext);
+                    throw error;
+                }
+            }
 
-		if (jobStatus == GramJob.STATUS_FAILED) {
-			String errorMsg = "Job " + job.getID() + " on host " + host.getHostAddress() + " Job Exit
Code = "
-					+ listener.getError();
-			JobSubmissionFault error = new JobSubmissionFault(this, new Exception(errorMsg), "GFAC
HOST", gateKeeper,
-					job.getRSL(), jobExecutionContext);
-			throw error;
-		}
-	}
+        }
+    }
 
 }



Mime
View raw message