airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [01/37] airavata git commit: handling a corner case in email handling from Airavata custom emails
Date Tue, 30 May 2017 19:02:21 GMT
Repository: airavata
Updated Branches:
  refs/heads/registry-refactoring a98d7fc35 -> 94d8ac2e3


handling a corner case in email handling from Airavata custom emails


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/56fefc98
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/56fefc98
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/56fefc98

Branch: refs/heads/registry-refactoring
Commit: 56fefc9845ab926f225edb7c787c1a676eefadb3
Parents: 7975778
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Mon Mar 6 13:05:45 2017 -0500
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Mon Mar 6 13:05:45 2017 -0500

----------------------------------------------------------------------
 .../airavata/gfac/monitor/email/EmailBasedMonitor.java   | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/56fefc98/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/monitor/email/EmailBasedMonitor.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/monitor/email/EmailBasedMonitor.java
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/monitor/email/EmailBasedMonitor.java
index 02dfa00..92f0d78 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/monitor/email/EmailBasedMonitor.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/monitor/email/EmailBasedMonitor.java
@@ -279,6 +279,12 @@ public class EmailBasedMonitor implements JobMonitor, Runnable{
                 if (taskContext != null) {
                     process(jobStatusResult, taskContext);
                     processedMessages.add(message);
+
+                } else if (addressMap.get(message.getFrom()).equals(ResourceJobManagerType.AIRAVATA_CUSTOM)
+                        && (new Date()).getTime() - message.getSentDate().getTime()
> 1000 * 6 * 5) {
+                    //marking old custom Airavata emails as read
+                    processedMessages.add(message);
+                    log.info("Marking old Airavata custom emails as read, message subject
--> {}", message.getSubject());
                 } else {
                     // we can get JobExecutionContext null in multiple Gfac instances environment,
                     // where this job is not submitted by this Gfac instance hence we ignore
this message.
@@ -357,14 +363,15 @@ public class EmailBasedMonitor implements JobMonitor, Runnable{
                 if (currentState != null && currentState == JobState.COMPLETE) {
                     jobMonitorMap.remove(jobStatusResult.getJobId());
                     runOutflowTasks = false;
-                    log.info("[EJM]: Job Complete email received , removed job from job monitoring.
" + jobDetails);
+                    log.info("[EJM]: Authoritative job Complete email received after early
Airavata custom complete email," +
+                            " removed job from job monitoring. " + jobDetails);
                 } else {
                     jobMonitorMap.remove(jobStatusResult.getJobId());
                     runOutflowTasks = true;
                     jobStatus.setJobState(JobState.COMPLETE);
                     jobStatus.setReason("Complete email received");
                     jobStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
-                    log.info("[EJM]: Job Complete email received , removed job from job monitoring.
" + jobDetails);
+                    log.info("[EJM]: Authoritative job Complete email received , removed
job from job monitoring. " + jobDetails);
                 }
             } else {
                 runOutflowTasks = true;


Mime
View raw message