OOZIE-3031 Coord job with only unresolved dependencies doesn't timeout (puru 
via satishsaley)

(cherry picked from commit 0a6f83e62126c60f9f9f2648368ed8bcf6293876)


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

Branch: refs/heads/branch-4.3
Commit: 2b9e132d7e89885a098e145d3c7204c3a0dd8072
Parents: b98c37e
Author: satishsaley <[email protected]>
Authored: Mon Oct 9 15:01:30 2017 -0700
Committer: satishsaley <[email protected]>
Committed: Sat Jan 6 12:26:39 2018 -0800

----------------------------------------------------------------------
 .../coord/CoordActionInputCheckXCommand.java       |  3 +--
 .../coord/TestCoordActionInputCheckXCommand.java   | 17 +++++++++++++++++
 release-log.txt                                    |  1 +
 3 files changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oozie/blob/2b9e132d/core/src/main/java/org/apache/oozie/command/coord/CoordActionInputCheckXCommand.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/oozie/command/coord/CoordActionInputCheckXCommand.java
 
b/core/src/main/java/org/apache/oozie/command/coord/CoordActionInputCheckXCommand.java
index 650e7f8..e16c61a 100644
--- 
a/core/src/main/java/org/apache/oozie/command/coord/CoordActionInputCheckXCommand.java
+++ 
b/core/src/main/java/org/apache/oozie/command/coord/CoordActionInputCheckXCommand.java
@@ -171,7 +171,6 @@ public class CoordActionInputCheckXCommand extends 
CoordinatorXCommand<Void> {
 
 
             boolean status = checkResolvedInput(actionXml, existList, 
nonExistList, actionConf);
-            String nonExistListStr = nonExistList.toString();
             boolean isPushDependenciesMet = 
coordPushInputDependency.isDependencyMet();
             if (status && nonResolvedList.length() > 0) {
                 status = (isPushDependenciesMet) ? 
checkUnResolvedInput(actionXml, actionConf) : false;
@@ -201,7 +200,7 @@ public class CoordActionInputCheckXCommand extends 
CoordinatorXCommand<Void> {
                 updateCoordAction(coordAction, isChangeInDependency);
             }
             else {
-                if (!nonExistListStr.isEmpty() && isPushDependenciesMet) {
+                if (isPushDependenciesMet) {
                     queue(new CoordActionTimeOutXCommand(coordAction, 
coordJob.getUser(), coordJob.getAppName()));
                 }
                 else {

http://git-wip-us.apache.org/repos/asf/oozie/blob/2b9e132d/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java
----------------------------------------------------------------------
diff --git 
a/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java
 
b/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java
index bbe9ea7..787a861 100644
--- 
a/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java
+++ 
b/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java
@@ -755,6 +755,23 @@ public class TestCoordActionInputCheckXCommand extends 
XDataTestCase {
     }
 
     @Test
+    public void testTimeoutWithUnResolved() throws Exception {
+        String jobId = "0000000-" + new Date().getTime() + 
"-TestCoordActionInputCheckXCommand-C";
+        Date startTime = DateUtils.parseDateOozieTZ("2009-02-15T23:59" + TZ);
+        Date endTime = DateUtils.parseDateOozieTZ("2009-02-16T23:59" + TZ);
+        CoordinatorJobBean job = addRecordToCoordJobTable(jobId, startTime, 
endTime, "latest");
+        new CoordMaterializeTransitionXCommand(job.getId(), 3600).call();
+        CoordinatorActionBean action = CoordActionQueryExecutor.getInstance()
+                .get(CoordActionQuery.GET_COORD_ACTION, job.getId() + "@1");
+        assertEquals(CoordCommandUtils.RESOLVED_UNRESOLVED_SEPARATOR + 
"${coord:latestRange(-3,0)}",
+                action.getMissingDependencies());
+        long timeOutCreationTime = System.currentTimeMillis() - (13 * 60 * 
1000);
+        setCoordActionCreationTime(action.getId(), timeOutCreationTime);
+        new CoordActionInputCheckXCommand(action.getId(), 
action.getJobId()).call();
+        checkCoordActionStatus(action.getId(),  
CoordinatorAction.Status.TIMEDOUT);
+    }
+
+    @Test
     public void testTimeoutWithException() throws Exception {
         String missingDeps = "nofs:///dirx/filex";
         String actionId = addInitRecords(missingDeps, null, TZ);

http://git-wip-us.apache.org/repos/asf/oozie/blob/2b9e132d/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 95b8415..416bed4 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -1,5 +1,6 @@
 -- Oozie 4.3.1 release
 
+OOZIE-3031 Coord job with only unresolved dependencies doesn't timeout (puru 
via satishsaley)
 OOZIE-3079 Filtering coordinators returns bundle id as null (satishsaley)
 OOZIE-3078 PasswordMasker throws NPE with null arguments (asasvari)
 OOZIE-3127 Remove redundant check for user (satishsaley)

Reply via email to