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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 1.1-beta
    • 1.0.3
    • Core
    • Security Level: Public
    • None
    • 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.

      Attachments

        For Gerrit Dashboard: JCBC-157
        # Subject Branch Project Status CR V

        Activity

          People

            ingenthr Matt Ingenthron
            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

                PagerDuty