hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weic...@apache.org
Subject hadoop git commit: HADOOP-13535. Add jetty6 acceptor startup issue workaround to branch-2. Contributed by Min Shen.
Date Fri, 23 Sep 2016 21:30:46 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8 367d5b2a7 -> 6ca5ffe4b


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

(cherry picked from commit 23984e17870bcff6fffd8e1ca185fd37e2352b29)


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

Branch: refs/heads/branch-2.8
Commit: 6ca5ffe4b52c13e71027c465c9a757724f6b091d
Parents: 367d5b2
Author: Wei-Chiu Chuang <weichiu@apache.org>
Authored: Fri Sep 23 14:25:52 2016 -0700
Committer: Wei-Chiu Chuang <weichiu@apache.org>
Committed: Fri Sep 23 14:28:00 2016 -0700

----------------------------------------------------------------------
 .../ssl/SslSelectChannelConnectorSecure.java    | 29 ++++++++++++++++++++
 1 file changed, 29 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/6ca5ffe4/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-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message