Uploaded image for project: 'Couchbase node.js Client Library'
  1. Couchbase node.js Client Library
  2. JSCBC-159

connect callback fires "successfully" after already firing an error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.0.2
    • 2.0.1
    • library
    • Security Level: Public
    • None
    • os x 10.0
      node v0.10.32
      libcoucebase 2.4.3
      Couchbase server 2.5.1-1083

    Description

      Not sure of the underlying cause but sometimes openBucket fails, and then the connect callback is called the 2nd time "successfully". Afterwards subsequent DB calls seem to hang.

      If I add some logging to Bucket constructor:

      this._cb.setConnectCallback(function(err) {
      console.log('connect callback');
      if (err)

      { this.connected = false; var errObj = new Error('failed to connect to bucket'); errObj.code = err; console.log(err); return this.emit('error', errObj); }

      console.log('bucket connected');
      this.connected = true;
      this.emit('connect');
      }.bind(this));

      I get:

      connect callback
      23
      connect callback
      bucket connected

      in a typical scenario openBucket would be called with function(err) that checks err (or attach it to 'connect' event), but the 2nd firing causes the context to think everything is OK. However the first subsequent DB call just seems to hang. I do not get any kind of errors thrown.

      There are possible workarounds, for example keeping an error flag in the calling context that's set on the 1st failure and handle the case that away.

      Attachments

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

        Activity

          People

            brett19 Brett Lawson
            bojand Bojan Djurkovic
            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