Uploaded image for project: 'Apache Curator'
  1. Apache Curator
  2. CURATOR-648

CuratorFramework#blockUntilConnected does now wait forever if waitTime <= 0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 5.4.0
    • Documentation
    • None

    Description

      CuratorFramework#blockUntilConnected documentation remarks the following: 

      maxWaitTime - The maximum wait time. Specify a value <= 0 to wait indefinitely

      This does not seem to be correct, if maxWaitTime <= 0 then blockUntilConnected returns immediately.

      I am able to reproduce this behaviour locally and from the code it is apparent to me that the cause is the logic in ConnectionStateManager#blockUntilConnected:

      boolean hasMaxWait = (units != null);

      Not sure what if the current behaviour is intended but I think misalignment probably should be fixed to prevent unexpected behaviour.

      What is the suggested fix here for this mismatch?

      If the implementation is changed to wait indefinitely, would it make sense to introduce a new method in CuratorFramework  to check the current curator connection state without having to wait?

       

      Attachments

        Activity

          People

            tison Zili Chen
            jmalves João Alves
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h