You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2013/05/01 18:27:13 UTC
svn commit: r1478077 -
/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GramProvider.java
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;
- }
- }
+ }
+ }
}