airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject airavata git commit: SendAck and remove process context if process is interrupted by cancel.
Date Mon, 21 Sep 2015 21:22:07 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 28ccb9f1b -> d59c3d712


SendAck and remove process context if process is interrupted by cancel.


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

Branch: refs/heads/master
Commit: d59c3d712b42926225a9e84557e32d5ce2c55b82
Parents: 28ccb9f
Author: Shameera Rathanyaka <shameerainfo@gmail.com>
Authored: Mon Sep 21 17:20:09 2015 -0400
Committer: Shameera Rathanyaka <shameerainfo@gmail.com>
Committed: Mon Sep 21 17:20:09 2015 -0400

----------------------------------------------------------------------
 .../org/apache/airavata/gfac/impl/GFacWorker.java   | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/d59c3d71/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacWorker.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacWorker.java
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacWorker.java
index d35819a..31f8643 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacWorker.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacWorker.java
@@ -81,6 +81,10 @@ public class GFacWorker implements Runnable {
 		try {
 			if (processContext.isInterrupted()) {
 				GFacUtils.handleProcessInterrupt(processContext);
+				if (processContext.isCancel()) {
+					sendAck();
+					Factory.getGfacContext().removeProcess(processContext.getProcessId());
+				}
 				return;
 			}
 			ProcessState processState = processContext.getProcessStatus().getState();
@@ -155,25 +159,33 @@ public class GFacWorker implements Runnable {
 
 	private void recoverProcessOutflow() throws GFacException {
 		engine.recoverProcessOutflow(processContext);
+		if (processContext.isInterrupted()) {
+			return;
+		}
 		completeProcess();
 	}
 
 	private void runProcessOutflow() throws GFacException {
 		engine.runProcessOutflow(processContext);
+		if (processContext.isInterrupted()) {
+			return;
+		}
 		completeProcess();
 	}
 
 	private void recoverProcess() throws GFacException {
 		engine.recoverProcess(processContext);
+		if (processContext.isInterrupted()) {
+			return;
+		}
 		monitorProcess();
 	}
 
 	private void executeProcess() throws GFacException {
+		engine.executeProcess(processContext);
 		if (processContext.isInterrupted()) {
-			GFacUtils.handleProcessInterrupt(processContext);
 			return;
 		}
-		engine.executeProcess(processContext);
 		monitorProcess();
 	}
 


Mime
View raw message