Commit f9f6beac authored by Michi Mutsuzaki's avatar Michi Mutsuzaki
Browse files

ZOOKEEPER-1057. zookeeper c-client, connection to offline server fails to...

ZOOKEEPER-1057. zookeeper c-client, connection to offline server fails to successfully fallback to second zk host (Germán Blanco via michim)


git-svn-id: https://svn.apache.org/repos/asf/zookeeper/branches/branch-3.4@1556949 13f79535-47bb-0310-9956-ffa450edef68
parent 7261cb88
......@@ -215,6 +215,9 @@ BUGFIXES:
ZOOKEEPER-1414. QuorumPeerMainTest.testQuorum, testBadPackets are failing
intermittently (Rakesh R via michim)
ZOOKEEPER-1057. zookeeper c-client, connection to offline server fails to
successfully fallback to second zk host (Germán Blanco via michim)
IMPROVEMENTS:
ZOOKEEPER-1564. Allow JUnit test build with IBM Java
......
......@@ -186,6 +186,7 @@ class Zookeeper_simpleSystem : public CPPUNIT_NS::TestFixture
CPPUNIT_TEST_SUITE(Zookeeper_simpleSystem);
CPPUNIT_TEST(testAsyncWatcherAutoReset);
CPPUNIT_TEST(testDeserializeString);
CPPUNIT_TEST(testFirstServerDown);
#ifdef THREADED
CPPUNIT_TEST(testNullData);
#ifdef ZOO_IPV6_ENABLED
......@@ -287,6 +288,17 @@ public:
struct String_vector str_vec = {0, NULL};
zrc = zoo_wget_children(zzh, "/mytest", default_zoo_watcher, NULL, &str_vec);
}
/** ZOOKEEPER-1057 This checks that the client connects to the second server when the first is not reachable **/
void testFirstServerDown() {
watchctx_t ctx;
zoo_deterministic_conn_order(true);
zhandle_t* zk = createClient("127.0.0.1:22182,127.0.0.1:22181", &ctx);
CPPUNIT_ASSERT(zk != 0);
CPPUNIT_ASSERT(ctx.waitForConnected(zk));
}
/** this checks for a deadlock in calling zookeeper_close and calls from a default watcher that might get triggered just when zookeeper_close() is in progress **/
void testHangingClient() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment