You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by el...@apache.org on 2016/09/23 22:15:41 UTC
[1/3] phoenix git commit: PHOENIX-3287 Retry starting KDC on
BindException
Repository: phoenix
Updated Branches:
refs/heads/4.x-HBase-0.98 ba132fe4c -> 591f3ce6e
refs/heads/4.x-HBase-1.1 dab384345 -> 42efa45e6
refs/heads/master fedbca8bf -> cb7234d3f
PHOENIX-3287 Retry starting KDC on BindException
MiniKDC has a race-condition in its port-allocation.
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/cb7234d3
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/cb7234d3
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/cb7234d3
Branch: refs/heads/master
Commit: cb7234d3f09c49f21e9a58a990c0efb141ddf6c5
Parents: fedbca8
Author: Josh Elser <el...@apache.org>
Authored: Fri Sep 23 14:29:50 2016 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Sep 23 17:54:40 2016 -0400
----------------------------------------------------------------------
.../phoenix/jdbc/SecureUserConnectionsTest.java | 27 +++++++++++++++-----
1 file changed, 21 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/cb7234d3/phoenix-core/src/test/java/org/apache/phoenix/jdbc/SecureUserConnectionsTest.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/test/java/org/apache/phoenix/jdbc/SecureUserConnectionsTest.java b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/SecureUserConnectionsTest.java
index a14e47b..4996f94 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/jdbc/SecureUserConnectionsTest.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/SecureUserConnectionsTest.java
@@ -31,13 +31,14 @@ import java.util.List;
import java.util.Properties;
import org.apache.commons.io.FileUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.CommonConfigurationKeys;
import org.apache.hadoop.hbase.security.User;
import org.apache.hadoop.minikdc.MiniKdc;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.security.authentication.util.KerberosName;
-import org.apache.hadoop.security.authentication.util.KerberosUtil;
import org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.ConnectionInfo;
import org.apache.phoenix.query.ConfigurationFactory;
import org.apache.phoenix.util.InstanceResolver;
@@ -54,6 +55,9 @@ import org.junit.Test;
* collide and when they do not.
*/
public class SecureUserConnectionsTest {
+ private static final Log LOG = LogFactory.getLog(SecureUserConnectionsTest.class);
+ private static final int KDC_START_ATTEMPTS = 10;
+
private static final File TEMP_DIR = new File(getClassTempDir());
private static final File KEYTAB_DIR = new File(TEMP_DIR, "keytabs");
private static final File KDC_DIR = new File(TEMP_DIR, "kdc");
@@ -68,11 +72,22 @@ public class SecureUserConnectionsTest {
public static void setupKdc() throws Exception {
ensureIsEmptyDirectory(KDC_DIR);
ensureIsEmptyDirectory(KEYTAB_DIR);
- // Create and start the KDC
- Properties kdcConf = MiniKdc.createConf();
- kdcConf.put(MiniKdc.DEBUG, true);
- KDC = new MiniKdc(kdcConf, KDC_DIR);
- KDC.start();
+ // Create and start the KDC. MiniKDC appears to have a race condition in how it does
+ // port allocation (with apache-ds). See PHOENIX-3287.
+ boolean started = false;
+ for (int i = 0; !started && i < KDC_START_ATTEMPTS; i++) {
+ Properties kdcConf = MiniKdc.createConf();
+ kdcConf.put(MiniKdc.DEBUG, true);
+ KDC = new MiniKdc(kdcConf, KDC_DIR);
+ try {
+ KDC.start();
+ started = true;
+ } catch (Exception e) {
+ LOG.warn("PHOENIX-3287: Failed to start KDC, retrying..", e);
+ }
+ }
+ assertTrue("The embedded KDC failed to start successfully after " + KDC_START_ATTEMPTS
+ + " attempts.", started);
createUsers(NUM_USERS);
[3/3] phoenix git commit: PHOENIX-3287 Retry starting KDC on
BindException
Posted by el...@apache.org.
PHOENIX-3287 Retry starting KDC on BindException
MiniKDC has a race-condition in its port-allocation.
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/591f3ce6
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/591f3ce6
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/591f3ce6
Branch: refs/heads/4.x-HBase-0.98
Commit: 591f3ce6e55eb52c9b98770210f1b8977e644c9f
Parents: ba132fe
Author: Josh Elser <el...@apache.org>
Authored: Fri Sep 23 14:29:50 2016 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Sep 23 18:09:08 2016 -0400
----------------------------------------------------------------------
.../phoenix/jdbc/SecureUserConnectionsTest.java | 27 +++++++++++++++-----
1 file changed, 21 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/591f3ce6/phoenix-core/src/test/java/org/apache/phoenix/jdbc/SecureUserConnectionsTest.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/test/java/org/apache/phoenix/jdbc/SecureUserConnectionsTest.java b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/SecureUserConnectionsTest.java
index a14e47b..4996f94 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/jdbc/SecureUserConnectionsTest.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/SecureUserConnectionsTest.java
@@ -31,13 +31,14 @@ import java.util.List;
import java.util.Properties;
import org.apache.commons.io.FileUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.CommonConfigurationKeys;
import org.apache.hadoop.hbase.security.User;
import org.apache.hadoop.minikdc.MiniKdc;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.security.authentication.util.KerberosName;
-import org.apache.hadoop.security.authentication.util.KerberosUtil;
import org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.ConnectionInfo;
import org.apache.phoenix.query.ConfigurationFactory;
import org.apache.phoenix.util.InstanceResolver;
@@ -54,6 +55,9 @@ import org.junit.Test;
* collide and when they do not.
*/
public class SecureUserConnectionsTest {
+ private static final Log LOG = LogFactory.getLog(SecureUserConnectionsTest.class);
+ private static final int KDC_START_ATTEMPTS = 10;
+
private static final File TEMP_DIR = new File(getClassTempDir());
private static final File KEYTAB_DIR = new File(TEMP_DIR, "keytabs");
private static final File KDC_DIR = new File(TEMP_DIR, "kdc");
@@ -68,11 +72,22 @@ public class SecureUserConnectionsTest {
public static void setupKdc() throws Exception {
ensureIsEmptyDirectory(KDC_DIR);
ensureIsEmptyDirectory(KEYTAB_DIR);
- // Create and start the KDC
- Properties kdcConf = MiniKdc.createConf();
- kdcConf.put(MiniKdc.DEBUG, true);
- KDC = new MiniKdc(kdcConf, KDC_DIR);
- KDC.start();
+ // Create and start the KDC. MiniKDC appears to have a race condition in how it does
+ // port allocation (with apache-ds). See PHOENIX-3287.
+ boolean started = false;
+ for (int i = 0; !started && i < KDC_START_ATTEMPTS; i++) {
+ Properties kdcConf = MiniKdc.createConf();
+ kdcConf.put(MiniKdc.DEBUG, true);
+ KDC = new MiniKdc(kdcConf, KDC_DIR);
+ try {
+ KDC.start();
+ started = true;
+ } catch (Exception e) {
+ LOG.warn("PHOENIX-3287: Failed to start KDC, retrying..", e);
+ }
+ }
+ assertTrue("The embedded KDC failed to start successfully after " + KDC_START_ATTEMPTS
+ + " attempts.", started);
createUsers(NUM_USERS);
[2/3] phoenix git commit: PHOENIX-3287 Retry starting KDC on
BindException
Posted by el...@apache.org.
PHOENIX-3287 Retry starting KDC on BindException
MiniKDC has a race-condition in its port-allocation.
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/42efa45e
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/42efa45e
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/42efa45e
Branch: refs/heads/4.x-HBase-1.1
Commit: 42efa45e6c497557e05564a533aeb5ff96432c4b
Parents: dab3843
Author: Josh Elser <el...@apache.org>
Authored: Fri Sep 23 14:29:50 2016 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Sep 23 18:02:42 2016 -0400
----------------------------------------------------------------------
.../phoenix/jdbc/SecureUserConnectionsTest.java | 27 +++++++++++++++-----
1 file changed, 21 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/42efa45e/phoenix-core/src/test/java/org/apache/phoenix/jdbc/SecureUserConnectionsTest.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/test/java/org/apache/phoenix/jdbc/SecureUserConnectionsTest.java b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/SecureUserConnectionsTest.java
index a14e47b..4996f94 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/jdbc/SecureUserConnectionsTest.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/SecureUserConnectionsTest.java
@@ -31,13 +31,14 @@ import java.util.List;
import java.util.Properties;
import org.apache.commons.io.FileUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.CommonConfigurationKeys;
import org.apache.hadoop.hbase.security.User;
import org.apache.hadoop.minikdc.MiniKdc;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.security.authentication.util.KerberosName;
-import org.apache.hadoop.security.authentication.util.KerberosUtil;
import org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.ConnectionInfo;
import org.apache.phoenix.query.ConfigurationFactory;
import org.apache.phoenix.util.InstanceResolver;
@@ -54,6 +55,9 @@ import org.junit.Test;
* collide and when they do not.
*/
public class SecureUserConnectionsTest {
+ private static final Log LOG = LogFactory.getLog(SecureUserConnectionsTest.class);
+ private static final int KDC_START_ATTEMPTS = 10;
+
private static final File TEMP_DIR = new File(getClassTempDir());
private static final File KEYTAB_DIR = new File(TEMP_DIR, "keytabs");
private static final File KDC_DIR = new File(TEMP_DIR, "kdc");
@@ -68,11 +72,22 @@ public class SecureUserConnectionsTest {
public static void setupKdc() throws Exception {
ensureIsEmptyDirectory(KDC_DIR);
ensureIsEmptyDirectory(KEYTAB_DIR);
- // Create and start the KDC
- Properties kdcConf = MiniKdc.createConf();
- kdcConf.put(MiniKdc.DEBUG, true);
- KDC = new MiniKdc(kdcConf, KDC_DIR);
- KDC.start();
+ // Create and start the KDC. MiniKDC appears to have a race condition in how it does
+ // port allocation (with apache-ds). See PHOENIX-3287.
+ boolean started = false;
+ for (int i = 0; !started && i < KDC_START_ATTEMPTS; i++) {
+ Properties kdcConf = MiniKdc.createConf();
+ kdcConf.put(MiniKdc.DEBUG, true);
+ KDC = new MiniKdc(kdcConf, KDC_DIR);
+ try {
+ KDC.start();
+ started = true;
+ } catch (Exception e) {
+ LOG.warn("PHOENIX-3287: Failed to start KDC, retrying..", e);
+ }
+ }
+ assertTrue("The embedded KDC failed to start successfully after " + KDC_START_ATTEMPTS
+ + " attempts.", started);
createUsers(NUM_USERS);