airavata-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suresh Marru <sma...@apache.org>
Subject Re: airavata git commit: cosmetic changes to job id check loop
Date Tue, 12 May 2015 15:54:06 GMT
Sure Shameera. I was not sure why few if’s were needed. But I did walk through recovery method
and I was suspecting some status changes might have side effect there.

Suresh

> On May 12, 2015, at 11:44 AM, Shameera Rathnayaka <shameerainfo@gmail.com> wrote:
> 
> Hi Suresh, 
> 
> This will cause to issue with JobStatus change hence i reverting this. BTW we already
need to verify jobId therefore we can't add it to if-else. need to use few if statements.
> 
> Shameera.
> 
> On Mon, May 11, 2015 at 9:00 PM, <smarru@apache.org <mailto:smarru@apache.org>>
wrote:
> Repository: airavata
> Updated Branches:
>   refs/heads/master badaa732f -> cdf979905
> 
> 
> cosmetic changes to job id check loop
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/airavata/repo <http://git-wip-us.apache.org/repos/asf/airavata/repo>
> Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/cdf97990 <http://git-wip-us.apache.org/repos/asf/airavata/commit/cdf97990>
> Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/cdf97990 <http://git-wip-us.apache.org/repos/asf/airavata/tree/cdf97990>
> Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/cdf97990 <http://git-wip-us.apache.org/repos/asf/airavata/diff/cdf97990>
> 
> Branch: refs/heads/master
> Commit: cdf97990540316fde2e434ca490a5c492aa6d4f3
> Parents: badaa73
> Author: Suresh Marru <smarru@apache.org <mailto:smarru@apache.org>>
> Authored: Mon May 11 21:00:10 2015 -0400
> Committer: Suresh Marru <smarru@apache.org <mailto:smarru@apache.org>>
> Committed: Mon May 11 21:00:10 2015 -0400
> 
> ----------------------------------------------------------------------
>  .../gfac/ssh/provider/impl/SSHProvider.java     | 22 +++++++++-----------
>  1 file changed, 10 insertions(+), 12 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/airavata/blob/cdf97990/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java
<http://git-wip-us.apache.org/repos/asf/airavata/blob/cdf97990/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java>
> ----------------------------------------------------------------------
> diff --git a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java
b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java
> index 2a3287b..cced757 100644
> --- a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java
> +++ b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java
> @@ -166,25 +166,23 @@ public class SSHProvider extends AbstractProvider {
>                      log.info <http://log.info/>(jobDescriptor.toXML());
> 
>                      jobDetails.setJobDescription(jobDescriptor.toXML());
> +                    jobExecutionContext.setJobDetails(jobDetails);
> 
>                      String jobID = cluster.submitBatchJob(jobDescriptor);
>                      if (jobID != null) {
>                          GFacUtils.saveJobStatus(jobExecutionContext, jobDetails, JobState.SUBMITTED);
> -                    }
> -                    jobExecutionContext.setJobDetails(jobDetails);
> -                    String verifyJobId = verifyJobSubmission(cluster, jobDetails);
> -                    if (verifyJobId != null) {
> -                        // JobStatus either changed from SUBMITTED to QUEUED or directly
to QUEUED
> -                        GFacUtils.saveJobStatus(jobExecutionContext, jobDetails, JobState.QUEUED);
> -                        if (jobID == null) {
> +                    } else {
> +                        String verifyJobId = verifyJobSubmission(cluster, jobDetails);
> +                        if (verifyJobId != null) {
> +                            // JobStatus either changed from SUBMITTED to QUEUED or
directly to QUEUED
> +                            GFacUtils.saveJobStatus(jobExecutionContext, jobDetails,
JobState.QUEUED);
>                              jobID = verifyJobId;
> +                        } else {
> +                            log.error("Couldn't find remote jobId for JobName:" + jobDetails.getJobName()
+ ", ExperimentId:" + jobExecutionContext.getExperimentID());
> +                            GFacUtils.updateExperimentStatus(jobExecutionContext.getExperimentID(),
ExperimentState.FAILED);
> +                            return;
>                          }
>                      }
> -                    if (jobID == null) {
> -                        log.error("Couldn't find remote jobId for JobName:" + jobDetails.getJobName()
+ ", ExperimentId:" + jobExecutionContext.getExperimentID());
> -                        GFacUtils.updateExperimentStatus(jobExecutionContext.getExperimentID(),
ExperimentState.FAILED);
> -                        return;
> -                    }
>                      jobDetails.setJobID(jobID);
>                      data.append("jobDesc=").append(jobDescriptor.toXML());
>                      data.append(",jobId=").append(jobDetails.getJobID());
> 
> 
> 
> 
> -- 
> Best Regards,
> Shameera Rathnayaka.
> 
> email: shameera AT apache.org <http://apache.org/> , shameerainfo AT gmail.com
<http://gmail.com/>
> Blog : http://shameerarathnayaka.blogspot.com/ <http://shameerarathnayaka.blogspot.com/>


Mime
View raw message