Repository: oozie Updated Branches: refs/heads/branch-4.1 530db06b3 -> 1505bf00e
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/1505bf00 Tree: http://git-wip-us.apache.org/repos/asf/oozie/tree/1505bf00 Diff: http://git-wip-us.apache.org/repos/asf/oozie/diff/1505bf00 Branch: refs/heads/branch-4.1 Commit: 1505bf00e56bc74a8ba1910f3e3720e44057c895 Parents: 530db06 Author: Purshotam Shah <[email protected]> Authored: Wed Oct 8 22:54:06 2014 -0700 Committer: Purshotam Shah <[email protected]> Committed: Wed Oct 8 22:54:06 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/1505bf00/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 f6e5b4f..52edca1 100644 --- a/core/src/main/java/org/apache/oozie/DagEngine.java +++ b/core/src/main/java/org/apache/oozie/DagEngine.java @@ -19,7 +19,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; @@ -291,7 +290,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/1505bf00/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 5dd06ca..3aa8dc4 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 @@ -117,6 +117,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, logInfo); WorkflowInstance oldWfInstance = this.wfBean.getWorkflowInstance(); @@ -141,7 +151,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); } @@ -153,9 +164,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 @@ -182,8 +194,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()); @@ -236,10 +248,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/1505bf00/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 c1695a2..0a0a25e 100644 --- a/core/src/test/java/org/apache/oozie/sla/TestSLAEventGeneration.java +++ b/core/src/test/java/org/apache/oozie/sla/TestSLAEventGeneration.java @@ -256,7 +256,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/1505bf00/release-log.txt ---------------------------------------------------------------------- diff --git a/release-log.txt b/release-log.txt index 2816a07..a36de24 100644 --- a/release-log.txt +++ b/release-log.txt @@ -1,4 +1,5 @@ -- Oozie 4.1.0 release (4.1 - unreleased) +OOZIE-2023 Job rerun can stuck in prep (puru) OOZIE-1932 Services should load CallableQueueService after MemoryLocksService (mona) OOZIE-1950 Coordinator job info should support timestamp (nominal time) (shwethags) OOZIE-1997 Oozie cannot materialize coordinator job with sqlserver in windows (bzhang)
