Repository: oozie Updated Branches: refs/heads/master a762991ab -> c4c028da0
OOZIE-1837 LauncherMainHadoopUtils sensitive to clock skew (rkanter) Project: http://git-wip-us.apache.org/repos/asf/oozie/repo Commit: http://git-wip-us.apache.org/repos/asf/oozie/commit/c4c028da Tree: http://git-wip-us.apache.org/repos/asf/oozie/tree/c4c028da Diff: http://git-wip-us.apache.org/repos/asf/oozie/diff/c4c028da Branch: refs/heads/master Commit: c4c028da0437dd539052ee39a28cdb44713eaad3 Parents: a762991 Author: Robert Kanter <[email protected]> Authored: Thu Jul 16 15:00:53 2015 -0700 Committer: Robert Kanter <[email protected]> Committed: Thu Jul 16 15:00:53 2015 -0700 ---------------------------------------------------------------------- .../oozie/action/hadoop/LauncherMainHadoopUtils.java | 12 +++++++++++- .../oozie/action/hadoop/LauncherMainHadoopUtils.java | 14 ++++++++++++-- release-log.txt | 1 + 3 files changed, 24 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/oozie/blob/c4c028da/hadooplibs/hadoop-utils-2/src/main/java/org/apache/oozie/action/hadoop/LauncherMainHadoopUtils.java ---------------------------------------------------------------------- diff --git a/hadooplibs/hadoop-utils-2/src/main/java/org/apache/oozie/action/hadoop/LauncherMainHadoopUtils.java b/hadooplibs/hadoop-utils-2/src/main/java/org/apache/oozie/action/hadoop/LauncherMainHadoopUtils.java index f6eda73..c4a0787 100644 --- a/hadooplibs/hadoop-utils-2/src/main/java/org/apache/oozie/action/hadoop/LauncherMainHadoopUtils.java +++ b/hadooplibs/hadoop-utils-2/src/main/java/org/apache/oozie/action/hadoop/LauncherMainHadoopUtils.java @@ -65,7 +65,17 @@ public class LauncherMainHadoopUtils { GetApplicationsRequest gar = GetApplicationsRequest.newInstance(); gar.setScope(ApplicationsRequestScope.OWN); gar.setApplicationTags(Collections.singleton(tag)); - gar.setStartRange(startTime, System.currentTimeMillis()); + long endTime = System.currentTimeMillis(); + if (startTime > endTime) { + System.out.println("WARNING: Clock skew between the Oozie server host and this host detected. Please fix this. " + + "Attempting to work around..."); + // We don't know which one is wrong (relative to the RM), so to be safe, let's assume they're both wrong and add an + // offset in both directions + long diff = 2 * (startTime - endTime); + startTime = startTime - diff; + endTime = endTime + diff; + } + gar.setStartRange(startTime, endTime); try { ApplicationClientProtocol proxy = ClientRMProxy.createRMProxy(actionConf, ApplicationClientProtocol.class); GetApplicationsResponse apps = proxy.getApplications(gar); http://git-wip-us.apache.org/repos/asf/oozie/blob/c4c028da/hadooplibs/hadoop-utils-3/src/main/java/org/apache/oozie/action/hadoop/LauncherMainHadoopUtils.java ---------------------------------------------------------------------- diff --git a/hadooplibs/hadoop-utils-3/src/main/java/org/apache/oozie/action/hadoop/LauncherMainHadoopUtils.java b/hadooplibs/hadoop-utils-3/src/main/java/org/apache/oozie/action/hadoop/LauncherMainHadoopUtils.java index 102a6c9..fb259e2 100644 --- a/hadooplibs/hadoop-utils-3/src/main/java/org/apache/oozie/action/hadoop/LauncherMainHadoopUtils.java +++ b/hadooplibs/hadoop-utils-3/src/main/java/org/apache/oozie/action/hadoop/LauncherMainHadoopUtils.java @@ -46,7 +46,7 @@ public class LauncherMainHadoopUtils { System.out.println("Fetching child yarn jobs"); long startTime = 0L; try { - startTime = Long.parseLong((System.getProperty("oozie.job.launch.time"))); + startTime = Long.parseLong((System.getProperty(OOZIE_JOB_LAUNCH_TIME))); } catch(NumberFormatException nfe) { throw new RuntimeException("Could not find Oozie job launch time", nfe); } @@ -62,7 +62,17 @@ public class LauncherMainHadoopUtils { GetApplicationsRequest gar = GetApplicationsRequest.newInstance(); gar.setScope(ApplicationsRequestScope.OWN); gar.setApplicationTags(Collections.singleton(tag)); - gar.setStartRange(startTime, System.currentTimeMillis()); + long endTime = System.currentTimeMillis(); + if (startTime > endTime) { + System.out.println("WARNING: Clock skew between the Oozie server host and this host detected. Please fix this. " + + "Attempting to work around..."); + // We don't know which one is wrong (relative to the RM), so to be safe, let's assume they're both wrong and add an + // offset in both directions + long diff = 2 * (startTime - endTime); + startTime = startTime - diff; + endTime = endTime + diff; + } + gar.setStartRange(startTime, endTime); try { ApplicationClientProtocol proxy = ClientRMProxy.createRMProxy(actionConf, ApplicationClientProtocol.class); GetApplicationsResponse apps = proxy.getApplications(gar); http://git-wip-us.apache.org/repos/asf/oozie/blob/c4c028da/release-log.txt ---------------------------------------------------------------------- diff --git a/release-log.txt b/release-log.txt index 4ffc302..abd63e7 100644 --- a/release-log.txt +++ b/release-log.txt @@ -1,5 +1,6 @@ -- Oozie 4.3.0 release (trunk - unreleased) +OOZIE-1837 LauncherMainHadoopUtils sensitive to clock skew (rkanter) OOZIE-2187 Add a way to specify a default JT/RM and NN (rkanter) OOZIE-2272 Use Hadoop's CredentialProvider for passwords in oozie-site (rkanter) OOZIE-2287 Add support for deleting hcat partitions in fs action delete (kailongs via rohini)
