Repository: hadoop
Updated Branches:
  refs/heads/branch-2.7 b2dfab432 -> f27cf17f7


HADOOP-13535. Add jetty6 acceptor startup issue workaround to branch-2. 
Contributed by Min Shen.

(cherry picked from commit 23984e17870bcff6fffd8e1ca185fd37e2352b29)
(cherry picked from commit 6ca5ffe4b52c13e71027c465c9a757724f6b091d)


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

Branch: refs/heads/branch-2.7
Commit: f27cf17f7e82f875e49d2e55f70c24cb941b4716
Parents: b2dfab4
Author: Wei-Chiu Chuang <weic...@apache.org>
Authored: Tue Oct 18 10:03:46 2016 -0700
Committer: Wei-Chiu Chuang <weic...@apache.org>
Committed: Tue Oct 18 10:03:46 2016 -0700

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt |  3 ++
 .../ssl/SslSelectChannelConnectorSecure.java    | 29 ++++++++++++++++++++
 2 files changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/f27cf17f/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt 
b/hadoop-common-project/hadoop-common/CHANGES.txt
index 556b9dc..4f16aa6 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -67,6 +67,9 @@ Release 2.7.4 - UNRELEASED
     HADOOP-13670. Update CHANGES.txt to reflect all the changes in branch-2.7.
     (Brahma Reddy Battula)
 
+    HADOOP-13535. Add jetty6 acceptor startup issue workaround to branch-2.
+    (Min Shen).
+
 Release 2.7.3 - 2016-08-25
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f27cf17f/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ssl/SslSelectChannelConnectorSecure.java
----------------------------------------------------------------------
diff --git 
a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ssl/SslSelectChannelConnectorSecure.java
 
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ssl/SslSelectChannelConnectorSecure.java
index 7de689b..7ff2292 100644
--- 
a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ssl/SslSelectChannelConnectorSecure.java
+++ 
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ssl/SslSelectChannelConnectorSecure.java
@@ -23,6 +23,8 @@ import java.util.ArrayList;
 
 import javax.net.ssl.SSLEngine;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.mortbay.jetty.security.SslSelectChannelConnector;
 
@@ -34,6 +36,8 @@ import org.mortbay.jetty.security.SslSelectChannelConnector;
  */
 @InterfaceAudience.Private
 public class SslSelectChannelConnectorSecure extends SslSelectChannelConnector 
{
+  public static final Log LOG =
+      LogFactory.getLog(SslSelectChannelConnectorSecure.class);
 
   public SslSelectChannelConnectorSecure() {
     super();
@@ -55,4 +59,29 @@ public class SslSelectChannelConnectorSecure extends 
SslSelectChannelConnector {
         new String[nonSSLProtocols.size()]));
     return engine;
   }
+
+  /* Override the broken isRunning() method (JETTY-1316). This bug is present
+   * in 6.1.26. For the versions wihout this bug, it adds insignificant
+   * overhead.
+   */
+  @Override
+  public boolean isRunning() {
+    if (super.isRunning()) {
+      return true;
+    }
+    // We might be hitting JETTY-1316. If the internal state changed from
+    // STARTING to STARTED in the middle of the check, the above call may
+    // return false.  Check it one more time.
+    LOG.warn("HttpServer Acceptor: isRunning is false. Rechecking.");
+    try {
+      Thread.sleep(10);
+    } catch (InterruptedException ie) {
+      // Mark this thread as interrupted. Someone up in the call chain
+      // might care.
+      Thread.currentThread().interrupt();
+    }
+    boolean runState = super.isRunning();
+    LOG.warn("HttpServer Acceptor: isRunning is " + runState);
+    return runState;
+  }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to