Details

    • Type: Story
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.0.12
    • Component/s: library
    • Security Level: Public
    • Labels:
      None
    • Environment:
      OS X Mountain Lion, SDK 0.0.11

      Description

      When you try to execute this code the application crashes:

      var async = require("async");
      var couchBase = require("couchbase");

      var json = {
      "id1":

      { "id": "id1", "name": "Name 1" }

      ,

      "id2":

      { "id": "id2", "name": "Name 2" }

      };

      var config =

      { "host": "localhost", "port": 8091, "username": "Administrator", "password": "password", "bucket": "requests" }

      ;

      couchBase.connect(config, function(err, bucket) {
      if (err)

      { console.log("Unable to connect to Couchbase bucket [" + config.bucket + "]", err); process.exit(1); }

      console.log("Connected to Couchbase");

      var ids = [];
      var jsonDocs = [];
      for (var key in json) {
      if (json.hasOwnProperty(key))

      { var jsonDoc = json[key]; var id = jsonDoc.id; jsonDocs.push(jsonDoc); ids.push(id); }

      }

      bucket.get(ids, null, function(err, docs, metas) {
      if (err) {
      for (var j = 0; j < err.length; j++) {
      if (err[j].code != 13) {
      console.log(

      { err: err }

      , "Unable to get existing entries using multiple get. Error in element [" + j + "]");
      process.exit(1);
      }
      }
      }
      console.log("Checked all docs for existance");

      async.map(jsonDocs, function(doc, callback) {
      bucket.set(doc.id, doc, {}, function(err)

      { callback(err); }

      );
      }, function(err, results) {
      if (err)

      { console.log("Unable to save all entries", err); process.exit(1); }

      console.log("Saved all entries");
      process.exit(0);
      });
      });
      });

      The question comes originally from:
      http://stackoverflow.com/questions/14829946/couchbase-2-0-on-node-js-crashes-when-using-multiple-get
      http://www.couchbase.com/forums/thread/couchbase-2-0-node-js-crash-mac-os-x-mountain-lion

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

        Activity

        Hide
        trond Trond Norbye added a comment -

        Can you "convert" the example into a testcase file in tests so that it is part of our test suite (note: it should fail now, but then I know when the bug is fixed and we won't get regressions later)

        Show
        trond Trond Norbye added a comment - Can you "convert" the example into a testcase file in tests so that it is part of our test suite (note: it should fail now, but then I know when the bug is fixed and we won't get regressions later)
        Hide
        mladen.markov Mladen Markov added a comment -

        Tested with libcouchbase 2.0.6 and couchbase node.js module 0.0.12 on Linux and it works.

        Show
        mladen.markov Mladen Markov added a comment - Tested with libcouchbase 2.0.6 and couchbase node.js module 0.0.12 on Linux and it works.

          People

          • Assignee:
            tgrall Tug Grall (Inactive)
            Reporter:
            tgrall Tug Grall (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes