Uploaded image for project: 'Couchbase C client library libcouchbase'
  1. Couchbase C client library libcouchbase
  2. CCBC-329

"connectionTimeout" and "operationTimeout" passed as options to the Connexion class do not work as expected

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.3.0
    • None
    • library
    • Security Level: Public
    • CenOS 6.4 X86_64
      libcouchbase2-libevent: 2.2.0
      libcouchbase-devel : 2.2.0
      node.js: v0.10.24
      couchnode: 1.2.1
      couchbase: 2.1.1 CE

    Description

      1. Pb 1 : "connectionTimeout"

      No DNS resolution | Use /etc/hosts only
      Create a couchnode "new Connexion" with options.host = couch1
      Set options.connectionTimeout to anything > 2999
      Set couch1 in /etc/hosts with an IP that is not assigned to any thing (No ping, nothing listening on 8091, etc )
      Run the js code that initiate the "new Connexion"

      ---> The error that specifies the connexion failure occurs minutes after the "new Connexion" has been initiated

      • connectionTimeout: 1000 -> "Connection Error { [Error: Connection failure] code: 24 }

        " Occurs ~2Sec after "new Connexion"

      • connectionTimeout: 2000 -> "Connection Error { [Error: Connection failure] code: 24 }

        " Occurs ~4Sec after "new Connexion"

      • connectionTimeout: 2999 -> "Connection Error { [Error: Connection failure] code: 24 }

        " Occurs ~4Sec after "new Connexion"

      • connectionTimeout: 3000 -> "Connection Error { [Error: Connection failure] code: 24 }

        " Occurs ~1Min30Sec after "new Connexion"

      • connectionTimeout: 4000 -> "Connection Error { [Error: Connection failure] code: 24 }

        " Occurs ~4Min30Sec after "new Connexion"

      • connectionTimeout: 5000 -> "Connection Error { [Error: Connection failure] code: 24 }

        " Occurs ... I have no idea : I just never happened after 15 minutes

      5000ms being the default for "connectionTimeout", when you do not specify it, operations are queued until your node.js blows up

      1. Pb 2 : "operationTimeout" :

      No DNS resolution | Use /etc/hosts only
      Identify couchbase nodes via a hostnames rather than IP address when you setup your cluster
      Create a couchnode "new Connexion" with options.host = couch1
      Do not set couch2 in /etc/hosts with any IP (So that resolution cannot happen)
      Run the js code that initiate the "new Connexion" to couch1 and db.get a key you know being on couch2

      ---> No error is never emitted or called back (you should get a "[Error: Operation timed out] code: 23" after 2500ms)

      Here is the dead simple code I am using to reproduce :

      var couchbase = require('couchbase');

      var options =

      { host: 'couch1:8091', bucket: 'bucket1', //connectionTimeout: 2999, //operationTimeout: 1000 }

      console.log(new Date(), "Script init");

      var db = new couchbase.Connection(options, function(err) {
      if (err)

      { console.log(new Date(), 'Connection Error', err); }

      else {
      console.log(new Date(), 'Connected!');

      var usr="myKey_on_couch2:bucket_1"

      console.log(new Date(), 'db.get');
      db.get(usr, function(err, res)

      { console.log(new Date(), err, res); }

      );

      }
      });

      Attachments

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

        Activity

          People

            mnunberg Mark Nunberg (Inactive)
            mxav@yahoo.com Xav M
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty