Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
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?