Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-1091

Undefined variable err in pool.js throws Error

      It seems like a function in pool.js is trying to access an undefined variable err

      pool.js, line 867:

      {{
      while(self.queue.length > 0) {
      var workItem = self.queue.shift();
      if(typeof workItem.cb == 'function')

      { workItem.cb(null, err); }

      }
      }}

      This leads to an unexpected Javascript error when loosing the connection due to timeout settings.

      {{
      node_modules/mongodb-core/lib/connection/pool.js:867
      workItem.cb(null, err);
      ^

      ReferenceError: err is not defined
      at Pool.destroy (/Users/masa/Code/docoyo.trackable/beacontrack.connectors/src/connectors2/node_modules/mongodb-core/lib/connection/pool.js:867:27)
      at Connection.<anonymous> (/Users/masa/Code/docoyo.trackable/beacontrack.connectors/src/connectors2/node_modules/mongodb-core/lib/connection/pool.js:265:14)
      at Connection.g (events.js:292:16)
      at emitTwo (events.js:106:13)
      at Connection.emit (events.js:191:7)
      at Socket.<anonymous> (/Users/masa/Code/docoyo.trackable/beacontrack.connectors/src/connectors2/node_modules/mongodb-core/lib/connection/connection.js:197:10)
      at Socket.g (events.js:292:16)
      at emitNone (events.js:86:13)
      at Socket.emit (events.js:185:7)
      at Socket._onTimeout (net.js:338:8)
      at ontimeout (timers.js:386:14)
      at tryOnTimeout (timers.js:250:5)
      at Timer.listOnTimeout (timers.js:214:5)
      }}

            Assignee:
            matt.broadstone@mongodb.com Matt Broadstone
            Reporter:
            masa Masanori Fujita
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: