OOZIE-2654 Zookeeper dependent services should not depend on Connectionstate to be valid before cleaning up (venkatnrangan via abhishekbafna)
(cherry picked from commit 1431ca4eca747df44073bc076339e13185305f30) Project: http://git-wip-us.apache.org/repos/asf/oozie/repo Commit: http://git-wip-us.apache.org/repos/asf/oozie/commit/a0c0ed99 Tree: http://git-wip-us.apache.org/repos/asf/oozie/tree/a0c0ed99 Diff: http://git-wip-us.apache.org/repos/asf/oozie/diff/a0c0ed99 Branch: refs/heads/branch-4.3 Commit: a0c0ed99cca79974300cfe191db948eb5d681376 Parents: 51eb9a8 Author: abhisek bafna <aba...@hortonworks.com> Authored: Fri Jan 6 13:07:03 2017 +0530 Committer: satishsaley <satishsa...@apache.org> Committed: Fri Dec 8 16:34:55 2017 -0800 ---------------------------------------------------------------------- .../java/org/apache/oozie/service/ZKJobsConcurrencyService.java | 2 +- core/src/main/java/org/apache/oozie/service/ZKLocksService.java | 2 +- core/src/main/java/org/apache/oozie/util/ZKUtils.java | 4 +--- release-log.txt | 1 + 4 files changed, 4 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/oozie/blob/a0c0ed99/core/src/main/java/org/apache/oozie/service/ZKJobsConcurrencyService.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/service/ZKJobsConcurrencyService.java b/core/src/main/java/org/apache/oozie/service/ZKJobsConcurrencyService.java index a64f613..93f5bf8 100644 --- a/core/src/main/java/org/apache/oozie/service/ZKJobsConcurrencyService.java +++ b/core/src/main/java/org/apache/oozie/service/ZKJobsConcurrencyService.java @@ -83,7 +83,7 @@ public class ZKJobsConcurrencyService extends JobsConcurrencyService implements */ @Override public void destroy() { - if (leaderLatch != null && ZKConnectionListener.getZKConnectionState() != ConnectionState.LOST) { + if (leaderLatch != null) { IOUtils.closeSafely(leaderLatch); } if (zk != null) { http://git-wip-us.apache.org/repos/asf/oozie/blob/a0c0ed99/core/src/main/java/org/apache/oozie/service/ZKLocksService.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/service/ZKLocksService.java b/core/src/main/java/org/apache/oozie/service/ZKLocksService.java index 8acbad9..83790cf 100644 --- a/core/src/main/java/org/apache/oozie/service/ZKLocksService.java +++ b/core/src/main/java/org/apache/oozie/service/ZKLocksService.java @@ -84,7 +84,7 @@ public class ZKLocksService extends MemoryLocksService implements Service, Instr */ @Override public void destroy() { - if (reaper != null && ZKConnectionListener.getZKConnectionState() != ConnectionState.LOST) { + if (reaper != null) { try { reaper.close(); } http://git-wip-us.apache.org/repos/asf/oozie/blob/a0c0ed99/core/src/main/java/org/apache/oozie/util/ZKUtils.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/util/ZKUtils.java b/core/src/main/java/org/apache/oozie/util/ZKUtils.java index 8069641..5835fb2 100644 --- a/core/src/main/java/org/apache/oozie/util/ZKUtils.java +++ b/core/src/main/java/org/apache/oozie/util/ZKUtils.java @@ -177,9 +177,7 @@ public class ZKUtils { // If there are no more classes using ZooKeeper, we should teardown everything. users.remove(user); if (users.isEmpty() && zk != null) { - if (ZKConnectionListener.getZKConnectionState() != ConnectionState.LOST) { - zk.teardown(); - } + zk.teardown(); zk = null; } } http://git-wip-us.apache.org/repos/asf/oozie/blob/a0c0ed99/release-log.txt ---------------------------------------------------------------------- diff --git a/release-log.txt b/release-log.txt index 648e52b..0f70852 100644 --- a/release-log.txt +++ b/release-log.txt @@ -1,5 +1,6 @@ -- Oozie 4.3.1 release +OOZIE-2654 Zookeeper dependent services should not depend on Connectionstate to be valid before cleaning up (venkatnrangan via abhishekbafna) OOZIE-2690 OOZIE NPE while executing kill() (abhishekbafna via jaydeepvishwakarma) -- Oozie 4.3.0 release