Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-4692

Handle SessionTimeoutException in Java client

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 3.8.1
    • None
    • java client
    • None

    Description

      The Java client sets a read timeout equal to 2/3 of the session timeout and throws a SessionTimeoutException when this is hit.

      https://github.com/apache/zookeeper/blob/89c1831f84891f425f1fa9224210587124f1c1ec/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxn.java#L1236-L1243

      However, the effect of that exception is not treated the same was as a SessionExpiredException which is propagated to the user and is treated as a disconnect event instead.

      This doesn't play very well with Curator which manages its own exception expiry client side and starts its countdown on disconnect events, meaning that it will consider the session lost a whole 2/3 of the session timeout after it actually expired.

      Should the SessionTimeoutException also be propagated to the users for handling and potentially considering the session lost from their end?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              giorgos.georgiou Giorgos Georgiou
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: