Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E365917C47 for ; Mon, 21 Sep 2015 21:22:07 +0000 (UTC) Received: (qmail 69233 invoked by uid 500); 21 Sep 2015 21:22:07 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 69189 invoked by uid 500); 21 Sep 2015 21:22:07 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 69180 invoked by uid 99); 21 Sep 2015 21:22:07 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Sep 2015 21:22:07 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9D470E0414; Mon, 21 Sep 2015 21:22:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: shameera@apache.org To: commits@airavata.apache.org Message-Id: <0a5e0cf6ec264f02a22854723b79f2ba@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: airavata git commit: SendAck and remove process context if process is interrupted by cancel. Date: Mon, 21 Sep 2015 21:22:07 +0000 (UTC) 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 Authored: Mon Sep 21 17:20:09 2015 -0400 Committer: Shameera Rathanyaka 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(); }