Github user Randgalt commented on a diff in the pull request:
https://github.com/apache/curator/pull/172#discussion_r86886157
--- Diff:
curator-client/src/main/java/org/apache/curator/ConnectionState.java ---
@@ -213,16 +213,14 @@ private synchronized void checkTimeouts() throws
Exception
* Return the current session id
*/
public long getSessionId() {
- long sessionId = -1;
- if (isConnected()) {
- try {
- ZooKeeper zk = zooKeeper.getZooKeeper();
- if (zk != null) {
- sessionId = zk.getSessionId();
- }
- } catch (Exception e) {
- // Ignore the exception
+ long sessionId = 0;
--- End diff --
My concern is that `zooKeeper.getZooKeeper()` can cause a new connection
to get started. I'm not sure that that kind of side-effect is expected. If
there is no current connection or the connection is in error somehow,
`zooKeeper.getZooKeeper()` will call `HandleHolder.closeAndReset()`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---