Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-157

Unsure if CouchbaseConnectionFactory.pastReconnThreshold really does what it's suppose to do

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.3
    • Fix Version/s: 1.1-beta
    • Component/s: Core
    • Security Level: Public
    • Labels:
      None
    • Environment:
      Oracle Jdk 1.6.0_26

      Description

        private boolean pastReconnThreshold() {
          long currentTime = System.nanoTime();
          if (currentTime - thresholdLastCheck > 100000000) { //if longer than 10 sec
            configThresholdCount = 0; // it's been more than 10 sec since last
                                      // tried, so don't try again just yet.
          }
          configThresholdCount++;
          thresholdLastCheck = currentTime;
       
          if (configThresholdCount >= maxConfigCheck) {
            return true;
          }
          return false;
        }
      

      Does the above really work as expected? It looks strange. 100000000 in nanos is only 100 millis and not 10 seconds as stated in comments.
      If there is more than 100 millis between calls we always reset configThresholdCount and will never return true, which seems very strange.

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        marcus.nylander@gmail.com Marcus Nylander created issue -
        daschl Michael Nitschinger made changes -
        Field Original Value New Value
        Assignee Michael Nitschinger [ daschl ] Matt Ingenthron [ ingenthr ]
        daschl Michael Nitschinger made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.1beta [ 10370 ]
        Resolution Fixed [ 1 ]
        ingenthr Matt Ingenthron made changes -
        Workflow jira [ 21982 ] Couchbase SDK Workflow [ 38446 ]

          People

          • Assignee:
            ingenthr Matt Ingenthron
            Reporter:
            marcus.nylander@gmail.com Marcus Nylander
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes