Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.1-incubating, 0.2
-
None
-
JPL internal JIRA
Description
LRUScheduler removes job, then adds it back if can't schedule which causes problem with Job Repo.
In LRUScheduler:
public void run() { .... exec = myJobQueue.getNextJob(); .... (on failure) myJobQueue.addJob(spec); }
In myJobQueue.getNextJob() (where myJobQueue is instanceof JobStack) the JobSpec is deleted and in addJob repo.addJob(JobSpec) is called as shown:
public String addJob(JobSpec spec) throws JobQueueException { String jobId = safeAddJob(spec); .... } private String safeAddJob(JobSpec spec) { .... return this.repo.addJob(spec); .... }
Point being: JobRepository should either do away with updateJob(JobSpec) method since in current implementation addJob(JobSpec) must support update to work properly, or replace getNextJob() with two different methods: peek() and delete(JobSpec)