Return-Path: X-Original-To: apmail-curator-dev-archive@minotaur.apache.org Delivered-To: apmail-curator-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 102E010BE5 for ; Thu, 26 Sep 2013 17:56:52 +0000 (UTC) Received: (qmail 56863 invoked by uid 500); 26 Sep 2013 17:56:51 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 56815 invoked by uid 500); 26 Sep 2013 17:56:49 -0000 Mailing-List: contact dev-help@curator.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.incubator.apache.org Delivered-To: mailing list dev@curator.incubator.apache.org Received: (qmail 56800 invoked by uid 99); 26 Sep 2013 17:56:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Sep 2013 17:56:47 +0000 X-ASF-Spam-Status: No, hits=-2002.3 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 26 Sep 2013 17:56:41 +0000 Received: (qmail 53588 invoked by uid 99); 26 Sep 2013 17:56:09 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Sep 2013 17:56:09 +0000 Date: Thu, 26 Sep 2013 17:56:09 +0000 (UTC) From: "Jordan Zimmerman (JIRA)" To: dev@curator.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (CURATOR-59) ConnectionState.CONNECTED can get set incorrectly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CURATOR-59?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jordan Zimmerman resolved CURATOR-59. ------------------------------------- Resolution: Fixed Fixed and pushed for next release > ConnectionState.CONNECTED can get set incorrectly > ------------------------------------------------- > > Key: CURATOR-59 > URL: https://issues.apache.org/jira/browse/CURATOR-59 > Project: Apache Curator > Issue Type: Bug > Components: Framework > Affects Versions: 2.2.0-incubating > Reporter: Jordan Zimmerman > Assignee: Jordan Zimmerman > Fix For: 2.3.0 > > > If the client is never able to connect to a server, it will incorrectly set ConnectionState.CONNECTED. > Example: > {code} > @Test > public void testNeverConnected() throws Exception > { > PersistentEphemeralNode persistentEphemeralNode = null; > // use a connection string to a non-existent server > CuratorFramework client = CuratorFrameworkFactory.newClient("localhost:1111", 100, 100, new RetryOneTime(1)); > try > { > final BlockingQueue queue = Queues.newLinkedBlockingQueue(); > ConnectionStateListener listener = new ConnectionStateListener() > { > @Override > public void stateChanged(CuratorFramework client, ConnectionState state) > { > queue.add(state); > } > }; > client.getConnectionStateListenable().addListener(listener); > client.start(); > // use a recipe that continuously retries > persistentEphemeralNode = new PersistentEphemeralNode(client, PersistentEphemeralNode.Mode.EPHEMERAL, "/abc/pen", "hello".getBytes()); > persistentEphemeralNode.start(); > Assert.assertEquals(queue.take(), ConnectionState.LOST); > } > finally > { > Closeables.closeQuietly(persistentEphemeralNode); > Closeables.closeQuietly(client); > } > } > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira