Skip to content

Commit

Permalink
Fixed pending jobs throwing an error
Browse files Browse the repository at this point in the history
  • Loading branch information
bpmweel committed Nov 28, 2017
1 parent b89b287 commit 8721546
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8721546

Please sign in to comment.