grisu/grisu — Issue #40: Fix 2-phase submit
Author: mondkaefer
Created: 2011-12-20 01:17:29+00:00
State: open

Send commit signal after receiving the final notification of a job in Gram5JobListener. Only then the job state file is removed and the job manager terminates after a period of inactivity after all jobs have been fully processed.
See description of two_phase RSL element here: http://globus.org/toolkit/docs/5.2/5.2.0/gram5/developer/#gram5-rsl-attribute-summary.

At the moment we don't send the commit signal upon receipt of the final job state notification, which causes us to accumulate job state files and unused job manager processes in certain situations. Too many job state files make Gram5 slow.

Example fix at the end of NotificationHandler.statusChanged(GramJob job):

int jobStatus = job.getStatus();
try {
if ((jobStatus == GramJob.STATUS_DONE) || (jobStatus == GramJob.STATUS_FAILED)){
job.signal(GramJob.SIGNAL_COMMIT_END);
}
} catch (Exception e) {
String state = job.getStatusAsString();
String id = job.getIDAsString();
log.error("Failed to send COMMIT_END to job " + id + " in state " + state, e);
}