You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2014/09/18 23:23:00 UTC
git commit: releasing finished jobs in separate threads rather
invoking output handlers one by one in a single thread. if output transfer
takes longer time monitring will be delayed
Repository: airavata
Updated Branches:
refs/heads/master 69ada188d -> 966142339
releasing finished jobs in separate threads rather invoking output handlers one by one in a single thread. if output transfer takes longer time monitring will be delayed
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/96614233
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/96614233
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/96614233
Branch: refs/heads/master
Commit: 966142339cfc93abb3ff005572982ec3a61eac01
Parents: 69ada18
Author: lahiru <la...@apache.org>
Authored: Thu Sep 18 17:21:25 2014 -0400
Committer: lahiru <la...@apache.org>
Committed: Thu Sep 18 17:21:25 2014 -0400
----------------------------------------------------------------------
.../monitor/impl/pull/qstat/HPCPullMonitor.java | 27 ++++++++++++--------
1 file changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/96614233/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
index 5260786..170030f 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
@@ -231,17 +231,22 @@ public class HPCPullMonitor extends PullMonitor {
// After successful monitoring perform follow ing actions to cleanup the queue, if necessary
if (jobStatus.getState().equals(JobState.COMPLETE)) {
completedJobs.add(iMonitorID);
- try {
- gfac.invokeOutFlowHandlers(iMonitorID.getJobExecutionContext());
- } catch (GFacException e) {
- publisher.publish(new TaskStatusChangeRequest(new TaskIdentity(iMonitorID.getExperimentID(), iMonitorID.getWorkflowNodeID(),
- iMonitorID.getTaskID()), TaskState.FAILED));
- //FIXME this is a case where the output retrieving fails even if the job execution was a success. Thus updating the task status
- //should be done understanding whole workflow of job submission and data transfer
-// publisher.publish(new ExperimentStatusChangedEvent(new ExperimentIdentity(iMonitorID.getExperimentID()),
-// ExperimentState.FAILED));
- logger.info(e.getLocalizedMessage(), e);
- }
+ // we run all the finished jobs in separate threads, because each job doesn't have to wait until
+ // each one finish transfering files
+ final MonitorID tMonitorID = iMonitorID;
+ (new Thread() {
+ @Override
+ public void run() {
+ try {
+ gfac.invokeOutFlowHandlers(tMonitorID.getJobExecutionContext());
+ } catch (GFacException e) {
+ publisher.publish(new TaskStatusChangeRequest(new TaskIdentity(tMonitorID.getExperimentID(), tMonitorID.getWorkflowNodeID(),
+ tMonitorID.getTaskID()), TaskState.FAILED));
+ //FIXME this is a case where the output retrieving fails even if the job execution was a success. Thus updating the task status
+ logger.info(e.getLocalizedMessage(), e);
+ }
+ }
+ }).start();
} else if (iMonitorID.getFailedCount() > FAILED_COUNT) {
logger.error("Tried to monitor the job with ID " + iMonitorID.getJobID() + " But failed" +iMonitorID.getFailedCount()+
" 3 times, so skip this Job from Monitor");