You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by vi...@apache.org on 2012/08/29 21:27:19 UTC

svn commit: r1378691 - in /incubator/oozie/branches/branch-3.3: core/src/main/java/org/apache/oozie/command/wf/ActionXCommand.java core/src/main/java/org/apache/oozie/command/wf/SuspendXCommand.java release-log.txt

Author: virag
Date: Wed Aug 29 19:27:19 2012
New Revision: 1378691

URL: http://svn.apache.org/viewvc?rev=1378691&view=rev
Log:
OOZIE-971 TestRecoveryService failing very often in pre-commit builds (mona via virag)

Modified:
    incubator/oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/command/wf/ActionXCommand.java
    incubator/oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/command/wf/SuspendXCommand.java
    incubator/oozie/branches/branch-3.3/release-log.txt

Modified: incubator/oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/command/wf/ActionXCommand.java
URL: http://svn.apache.org/viewvc/incubator/oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/command/wf/ActionXCommand.java?rev=1378691&r1=1378690&r2=1378691&view=diff
==============================================================================
--- incubator/oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/command/wf/ActionXCommand.java (original)
+++ incubator/oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/command/wf/ActionXCommand.java Wed Aug 29 19:27:19 2012
@@ -123,7 +123,7 @@ public abstract class ActionXCommand<T> 
         action.resetPendingOnly();
         LOG.warn("Suspending Workflow Job id=" + id);
         try {
-            SuspendXCommand.suspendJob(Services.get().get(JPAService.class), workflow, id, action.getId());
+            SuspendXCommand.suspendJob(Services.get().get(JPAService.class), workflow, id, action.getId(), null);
         }
         catch (Exception e) {
             throw new CommandException(ErrorCode.E0727, e.getMessage());

Modified: incubator/oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/command/wf/SuspendXCommand.java
URL: http://svn.apache.org/viewvc/incubator/oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/command/wf/SuspendXCommand.java?rev=1378691&r1=1378690&r2=1378691&view=diff
==============================================================================
--- incubator/oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/command/wf/SuspendXCommand.java (original)
+++ incubator/oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/command/wf/SuspendXCommand.java Wed Aug 29 19:27:19 2012
@@ -46,7 +46,7 @@ public class SuspendXCommand extends Wor
     private final String wfid;
     private WorkflowJobBean wfJobBean;
     private JPAService jpaService;
-    private static List<JsonBean> updateList = new ArrayList<JsonBean>();
+    private List<JsonBean> updateList = new ArrayList<JsonBean>();
 
     public SuspendXCommand(String id) {
         super("suspend", "suspend", 1);
@@ -60,7 +60,7 @@ public class SuspendXCommand extends Wor
     protected Void execute() throws CommandException {
         InstrumentUtils.incrJobCounter(getName(), 1, getInstrumentation());
         try {
-            suspendJob(this.jpaService, this.wfJobBean, this.wfid, null);
+            suspendJob(this.jpaService, this.wfJobBean, this.wfid, null, updateList);
             this.wfJobBean.setLastModifiedTime(new Date());
             updateList.add(this.wfJobBean);
             jpaService.execute(new BulkUpdateInsertJPAExecutor(updateList, null));
@@ -90,8 +90,8 @@ public class SuspendXCommand extends Wor
      * @throws WorkflowException thrown if failed to suspend workflow instance
      * @throws CommandException thrown if unable set pending false for actions
      */
-    public static void suspendJob(JPAService jpaService, WorkflowJobBean workflow, String id, String actionId)
-            throws WorkflowException, CommandException {
+    public static void suspendJob(JPAService jpaService, WorkflowJobBean workflow, String id,
+            String actionId, List<JsonBean> updateList) throws WorkflowException, CommandException {
         if (workflow.getStatus() == WorkflowJob.Status.RUNNING) {
             workflow.getWorkflowInstance().suspend();
             WorkflowInstance wfInstance = workflow.getWorkflowInstance();
@@ -99,7 +99,7 @@ public class SuspendXCommand extends Wor
             workflow.setStatus(WorkflowJob.Status.SUSPENDED);
             workflow.setWorkflowInstance(wfInstance);
 
-            setPendingFalseForActions(jpaService, id, actionId);
+            setPendingFalseForActions(jpaService, id, actionId, updateList);
         }
     }
 
@@ -112,8 +112,8 @@ public class SuspendXCommand extends Wor
      * @param actionId workflow action id
      * @throws CommandException thrown if failed to update workflow action
      */
-    private static void setPendingFalseForActions(JPAService jpaService, String id, String actionId)
-            throws CommandException {
+    private static void setPendingFalseForActions(JPAService jpaService, String id, String actionId,
+            List<JsonBean> updateList) throws CommandException {
         List<WorkflowActionBean> actions;
         try {
             actions = jpaService.execute(new WorkflowActionRetryManualGetJPAExecutor(id));
@@ -126,8 +126,11 @@ public class SuspendXCommand extends Wor
                 else {
                     action.resetPendingOnly();
                 }
-                updateList.add(action);
-
+                if (updateList != null) { // will be null when suspendJob
+                                          // invoked statically via
+                                          // handleNonTransient()
+                    updateList.add(action);
+                }
             }
         }
         catch (JPAExecutorException je) {

Modified: incubator/oozie/branches/branch-3.3/release-log.txt
URL: http://svn.apache.org/viewvc/incubator/oozie/branches/branch-3.3/release-log.txt?rev=1378691&r1=1378690&r2=1378691&view=diff
==============================================================================
--- incubator/oozie/branches/branch-3.3/release-log.txt (original)
+++ incubator/oozie/branches/branch-3.3/release-log.txt Wed Aug 29 19:27:19 2012
@@ -1,5 +1,6 @@
 -- Oozie 3.3.0 release (trunk - unreleased)
 
+OOZIE-971 TestRecoveryService failing very often in pre-commit builds (mona via virag)
 OOZIE-960 TestStatusTransitService failing intermittently (virag)
 OOZIE-968 source oozie environment from conf in oozie db setup script (svenkat via virag)
 OOZIE-944 Implement Workflow Generator UI Tool (egashira via virag)