Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
-
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
- 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
—
- 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)
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)
);
}
});