You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The singleton pattern is not correctly implemented in the class CouchbaseDB :
`
CouchbaseDB.prototype.connect = function (callback) {
var self = this;
if (self.db) {
process.nextTick(function () {
callback && callback(null, self.db);
});
} else {
self.myCluster = new couchbase.Cluster(self.settings.connectUrl);
callback && callback(null, self.db);
}
};
`
The variable self.db is never initialized which causes the connector to create a new connection to couchbase each time a request is made to the datasource.
This leads to memory leaks and, in case of heavy load, a crash of couchbase node (or at least it put the node in an unhealthy state)
Regards,
The text was updated successfully, but these errors were encountered:
Hi,
The singleton pattern is not correctly implemented in the class CouchbaseDB :
`
CouchbaseDB.prototype.connect = function (callback) {
var self = this;
if (self.db) {
process.nextTick(function () {
callback && callback(null, self.db);
});
} else {
self.myCluster = new couchbase.Cluster(self.settings.connectUrl);
callback && callback(null, self.db);
}
};
`
The variable self.db is never initialized which causes the connector to create a new connection to couchbase each time a request is made to the datasource.
This leads to memory leaks and, in case of heavy load, a crash of couchbase node (or at least it put the node in an unhealthy state)
Regards,
The text was updated successfully, but these errors were encountered: