Details
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)
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.