From 8721546d20a085b232aad1e0691d208642a8320d Mon Sep 17 00:00:00 2001 From: Berend Weel Date: Tue, 28 Nov 2017 15:07:56 +0100 Subject: [PATCH] Fixed pending jobs throwing an error --- build.gradle | 2 ++ .../computeservice/config/TargetAdaptorConfig.java | 4 ++-- .../rest/service/tasks/XenonMonitoringTask.java | 5 ++--- src/main/resources/application.properties | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index f5f1249..6cfcdb6 100644 --- a/build.gradle +++ b/build.gradle @@ -8,6 +8,8 @@ plugins { id 'org.springframework.boot' version '1.5.6.RELEASE' } +version = '0.3-alpha' + springBoot { mainClass = 'nl.esciencecenter.computeservice.rest.Swagger2SpringBoot' } diff --git a/src/main/java/nl/esciencecenter/computeservice/config/TargetAdaptorConfig.java b/src/main/java/nl/esciencecenter/computeservice/config/TargetAdaptorConfig.java index ba12129..3dfa299 100644 --- a/src/main/java/nl/esciencecenter/computeservice/config/TargetAdaptorConfig.java +++ b/src/main/java/nl/esciencecenter/computeservice/config/TargetAdaptorConfig.java @@ -8,7 +8,7 @@ public class TargetAdaptorConfig extends AdaptorConfig { @JsonProperty(value="baseurl", required=false) - private String baseurl = "/output"; + private String baseurl = "output"; @JsonProperty(value="hosted", required=false) private boolean hosted = false; @@ -28,7 +28,7 @@ public String getBaseurl() { public void setBaseurl(String baseurl) { if (baseurl == null) { - this.baseurl = "/output"; + this.baseurl = "output"; } else { this.baseurl = baseurl; } diff --git a/src/main/java/nl/esciencecenter/computeservice/rest/service/tasks/XenonMonitoringTask.java b/src/main/java/nl/esciencecenter/computeservice/rest/service/tasks/XenonMonitoringTask.java index 72efa55..8799a46 100644 --- a/src/main/java/nl/esciencecenter/computeservice/rest/service/tasks/XenonMonitoringTask.java +++ b/src/main/java/nl/esciencecenter/computeservice/rest/service/tasks/XenonMonitoringTask.java @@ -109,6 +109,7 @@ private void updateWaitingJobs(Scheduler scheduler) { // We re-request the job here because it may have changed while we were looping. job = repository.findOne(job.getId()); String xenonJobId = job.getXenonId(); + if (xenonJobId != null && !xenonJobId.isEmpty()) { try { JobStatus status = scheduler.getJobStatus(xenonJobId); @@ -128,9 +129,7 @@ private void updateWaitingJobs(Scheduler scheduler) { jobService.setXenonExitcode(job.getId(), status.getExitCode()); jobService.setJobState(job.getId(), JobState.WAITING, JobState.FINISHED); } else { - jobLogger.error( - "Exception during execution, Job is in an inconsistent state for workflowtask: " + job + "Excepected WAITING"); - jobService.setJobState(job.getId(), job.getInternalState(), JobState.PERMANENT_FAILURE); + // The job is probably pending } jobService.setXenonState(job.getId(), status.getState()); diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 3b96134..35d0c27 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -8,8 +8,8 @@ spring.jackson.date-format=nl.esciencecenter.computeservice.rest.RFC3339DateForm spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false logging.level.root=WARN -logging.level.org.springframework=INFO -logging.level.springfox=INFO +logging.level.org.springframework=WARN +logging.level.springfox=WARN logging.level.org.hibernate=WARN logging.level.org.apache=WARN logging.level.nl.esciencecenter=DEBUG