airavata-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shameera Rathnayaka <shameerai...@gmail.com>
Subject Re: airavata git commit: cosmetic changes to job id check loop
Date Tue, 12 May 2015 15:44:50 GMT
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> 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
> Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/cdf97990
> Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/cdf97990
> Diff: 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>
> Authored: Mon May 11 21:00:10 2015 -0400
> Committer: Suresh Marru <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
> ----------------------------------------------------------------------
> 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(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 , shameerainfo AT gmail.com
Blog : http://shameerarathnayaka.blogspot.com/

Mime
View raw message