You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by "jira-importer (via GitHub)" <gi...@apache.org> on 2025/01/21 13:12:41 UTC
[I] [CURATOR-59] ConnectionState.CONNECTED can get set incorrectly [curator]
jira-importer opened a new issue, #580:
URL: https://github.com/apache/curator/issues/580
<p>If the client is never able to connect to a server, it will incorrectly set ConnectionState.CONNECTED. </p>
<p>Example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"> @Test
<span class="code-keyword">public</span> void testNeverConnected() <span class="code-keyword">throws</span> Exception
{
PersistentEphemeralNode persistentEphemeralNode = <span class="code-keyword">null</span>;
<span class="code-comment">// use a connection string to a non-existent server
</span>CuratorFramework client = CuratorFrameworkFactory.newClient(<span class="code-quote">"localhost:1111"</span>, 100, 100, <span class="code-keyword">new</span> RetryOneTime(1));
<span class="code-keyword">try</span>
{
<span class="code-keyword">final</span> BlockingQueue<ConnectionState> queue = Queues.newLinkedBlockingQueue();
ConnectionStateListener listener = <span class="code-keyword">new</span> ConnectionStateListener()
{
@Override
<span class="code-keyword">public</span> void stateChanged(CuratorFramework client, ConnectionState state)
{
queue.add(state);
}
};
client.getConnectionStateListenable().addListener(listener);
client.start();
<span class="code-comment">// use a recipe that continuously retries
</span> persistentEphemeralNode = <span class="code-keyword">new</span> PersistentEphemeralNode(client, PersistentEphemeralNode.Mode.EPHEMERAL, <span class="code-quote">"/abc/pen"</span>, <span class="code-quote">"hello"</span>.getBytes());
persistentEphemeralNode.start();
Assert.assertEquals(queue.take(), ConnectionState.LOST);
}
<span class="code-keyword">finally</span>
{
Closeables.closeQuietly(persistentEphemeralNode);
Closeables.closeQuietly(client);
}
}
</pre>
</div></div>
---
<details><summary><i>Originally reported by <a title="Jordan Zimmerman" href="https://issues.apache.org/jira/secure/ViewProfile.jspa?name=randgalt">randgalt</a>, imported from: <a href="https://issues.apache.org/jira/browse/CURATOR-59" target="_blank">ConnectionState.CONNECTED can get set incorrectly</a></i></summary>
<i><ul>
<li><b>assignee</b>: <a title="Jordan Zimmerman" href="https://issues.apache.org/jira/secure/ViewProfile.jspa?name=randgalt">randgalt</a>
<li><b>status</b>: Resolved
<li><b>priority</b>: Major
<li><b>resolution</b>: Fixed
<li><b>resolved</b>: 2013-09-26T18:56:00+01:00
<li><b>imported</b>: 2025-01-21
</ul></i>
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@curator.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [CURATOR-59] ConnectionState.CONNECTED can get set incorrectly [curator]
Posted by "jira-importer (via GitHub)" <gi...@apache.org>.
jira-importer commented on issue #580:
URL: https://github.com/apache/curator/issues/580#issuecomment-2604699820
<i><a href="https://issues.apache.org/jira/secure/ViewProfile.jspa?name=randgalt">randgalt</a>:</i>
<p>Fixed and pushed for next release</p>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@curator.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org