Repository: oozie
Updated Branches:
  refs/heads/master 2f2b34882 -> 28ae55147


OOZIE-2023 Job rerun can stuck in prep


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

Branch: refs/heads/master
Commit: 28ae55147891ddc9d26ab0bb2824e7cd537ae9f5
Parents: 2f2b348
Author: Purshotam Shah <[email protected]>
Authored: Wed Oct 8 22:51:11 2014 -0700
Committer: Purshotam Shah <[email protected]>
Committed: Wed Oct 8 22:51:11 2014 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/oozie/DagEngine.java   |  2 --
 .../apache/oozie/command/wf/ReRunXCommand.java  | 26 ++++++++++++++------
 .../oozie/sla/TestSLAEventGeneration.java       |  2 +-
 release-log.txt                                 |  1 +
 4 files changed, 20 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oozie/blob/28ae5514/core/src/main/java/org/apache/oozie/DagEngine.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/oozie/DagEngine.java 
b/core/src/main/java/org/apache/oozie/DagEngine.java
index edb4d54..bea312f 100644
--- a/core/src/main/java/org/apache/oozie/DagEngine.java
+++ b/core/src/main/java/org/apache/oozie/DagEngine.java
@@ -20,7 +20,6 @@ package org.apache.oozie;
 
 import org.apache.oozie.service.XLogService;
 import org.apache.oozie.service.DagXLogInfoService;
-import org.apache.commons.lang.StringUtils;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.oozie.client.CoordinatorJob;
 import org.apache.oozie.client.WorkflowJob;
@@ -292,7 +291,6 @@ public class DagEngine extends BaseEngine {
             XConfiguration.copy(conf, wfConf);
             validateReRunConfiguration(wfConf);
             new ReRunXCommand(jobId, wfConf).call();
-            start(jobId);
         }
         catch (CommandException ex) {
             throw new DagEngineException(ex);

http://git-wip-us.apache.org/repos/asf/oozie/blob/28ae5514/core/src/main/java/org/apache/oozie/command/wf/ReRunXCommand.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/oozie/command/wf/ReRunXCommand.java 
b/core/src/main/java/org/apache/oozie/command/wf/ReRunXCommand.java
index 45856a3..4f2e975 100644
--- a/core/src/main/java/org/apache/oozie/command/wf/ReRunXCommand.java
+++ b/core/src/main/java/org/apache/oozie/command/wf/ReRunXCommand.java
@@ -123,6 +123,16 @@ public class ReRunXCommand extends WorkflowXCommand<Void> {
      */
     @Override
     protected Void execute() throws CommandException {
+        setupReRun();
+        startWorkflow(jobId);
+        return null;
+    }
+
+    private void startWorkflow(String jobId) throws CommandException {
+        new StartXCommand(jobId).call();
+    }
+
+    private void setupReRun() throws CommandException {
         InstrumentUtils.incrJobCounter(getName(), 1, getInstrumentation());
         LogUtils.setLogInfo(wfBean);
         WorkflowInstance oldWfInstance = this.wfBean.getWorkflowInstance();
@@ -147,7 +157,8 @@ public class ReRunXCommand extends WorkflowXCommand<Void> {
             Path path = new Path(uri.getPath());
             if (!fs.isFile(path)) {
                 configDefault = new Path(path, SubmitXCommand.CONFIG_DEFAULT);
-            } else {
+            }
+            else {
                 configDefault = new Path(path.getParent(), 
SubmitXCommand.CONFIG_DEFAULT);
             }
 
@@ -159,9 +170,10 @@ public class ReRunXCommand extends WorkflowXCommand<Void> {
 
             PropertiesUtils.checkDisallowedProperties(conf, 
DISALLOWED_USER_PROPERTIES);
 
-            // Resolving all variables in the job properties. This ensures the 
Hadoop Configuration semantics are preserved.
-            // The Configuration.get function within XConfiguration.resolve() 
works recursively to get the final value corresponding to a key in the map
-            // Resetting the conf to contain all the resolved values is 
necessary to ensure propagation of Oozie properties to Hadoop calls downstream
+            // Resolving all variables in the job properties. This ensures the 
Hadoop Configuration semantics are
+            // preserved. The Configuration.get function within 
XConfiguration.resolve() works recursively to get the
+            // final value corresponding to a key in the map Resetting the 
conf to contain all the resolved values is
+            // necessary to ensure propagation of Oozie properties to Hadoop 
calls downstream
             conf = ((XConfiguration) conf).resolve();
 
             // Prepare the action endtimes map
@@ -188,8 +200,8 @@ public class ReRunXCommand extends WorkflowXCommand<Void> {
                     jobSlaXml = SubmitXCommand.resolveSla(eSla, evalSla);
                 }
                 writeSLARegistration(wfElem, jobSlaXml, newWfInstance.getId(),
-                            conf.get(SubWorkflowActionExecutor.PARENT_ID), 
conf.get(OozieClient.USER_NAME), appName,
-                            evalSla);
+                        conf.get(SubWorkflowActionExecutor.PARENT_ID), 
conf.get(OozieClient.USER_NAME), appName,
+                        evalSla);
             }
             wfBean.setAppName(appName);
             wfBean.setProtoActionConf(protoActionConf.toXmlString());
@@ -242,10 +254,8 @@ public class ReRunXCommand extends WorkflowXCommand<Void> {
             throw new CommandException(je);
         }
 
-        return null;
     }
 
-
     @SuppressWarnings("unchecked")
        private void writeSLARegistration(Element wfElem, String jobSlaXml, 
String id, String parentId, String user,
             String appName, ELEvaluator evalSla) throws JDOMException, 
CommandException {

http://git-wip-us.apache.org/repos/asf/oozie/blob/28ae5514/core/src/test/java/org/apache/oozie/sla/TestSLAEventGeneration.java
----------------------------------------------------------------------
diff --git 
a/core/src/test/java/org/apache/oozie/sla/TestSLAEventGeneration.java 
b/core/src/test/java/org/apache/oozie/sla/TestSLAEventGeneration.java
index 14842a3..e47e17f 100644
--- a/core/src/test/java/org/apache/oozie/sla/TestSLAEventGeneration.java
+++ b/core/src/test/java/org/apache/oozie/sla/TestSLAEventGeneration.java
@@ -257,7 +257,7 @@ public class TestSLAEventGeneration extends XDataTestCase {
         ehs.getEventQueue().clear();
         slas.runSLAWorker();
         slaEvent = (SLACalcStatus) ehs.getEventQueue().poll();
-        assertEquals(SLAStatus.NOT_STARTED, slaEvent.getSLAStatus());
+        assertEquals(SLAStatus.IN_PROCESS, slaEvent.getSLAStatus());
         assertEquals(EventStatus.START_MISS, slaEvent.getEventStatus());
 
     }

http://git-wip-us.apache.org/repos/asf/oozie/blob/28ae5514/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index bcbc9e8..73dff63 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -1,5 +1,6 @@
 -- Oozie 4.2.0 release (trunk - unreleased)
 
+OOZIE-2023 Job rerun can stuck in prep (puru)
 OOZIE-2017 On startup, StatusTransitService can transition Coordinators that 
were in PREPSUSPENDED to RUNNING (rkanter)
 OOZIE-1940 StatusTransitService has race condition (puru)
 OOZIE-1696 Document how to get the action conf in the Java action (jrkinley 
via rkanter)

Reply via email to