Github user lvfangmin commented on a diff in the pull request:
https://github.com/apache/curator/pull/172#discussion_r86048959
--- 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 --
We also want to track the sessionId when the connection timed-out happened,
also it would be useful if we can know what's the disconnected session id when
the create/setData/getData is called.
Any concern of removing the isConnected() check?
---
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.
---