Open royigoldi opened 5 years ago
Hi,
when I tried to work with the jdbc to Apache Impala and the impala server stuck, also the node.js server stuck on reserve:
Pool.prototype.reserve = function(callback) { var self = this; var conn = null; self._closeIdleConnections();
if (self._pool.length > 0 ) { conn = self._pool.shift();
if (conn.lastIdle) { conn.lastIdle = new Date().getTime(); } self._reserved.unshift(conn);
} else if (self._reserved.length < self._maxpoolsize) { try { conn = addConnectionSync(self._url, self._props, self._keepalive, self._maxidle); self._reserved.unshift(conn); } catch (err) { winston.error(err); conn = null; return callback(err); } }
I want to ask please, why you call to add connectionSync inside the reserve function beacuse the event loop are waiting to the connection and stay in stuck mode. it should be async!!!
Thanks a lot, Royi
Hi,
when I tried to work with the jdbc to Apache Impala and the impala server stuck, also the node.js server stuck on reserve:
Pool.prototype.reserve = function(callback) { var self = this; var conn = null; self._closeIdleConnections();
if (self._pool.length > 0 ) { conn = self._pool.shift();
} else if (self._reserved.length < self._maxpoolsize) { try { conn = addConnectionSync(self._url, self._props, self._keepalive, self._maxidle); self._reserved.unshift(conn); } catch (err) { winston.error(err); conn = null; return callback(err); } }
I want to ask please, why you call to add connectionSync inside the reserve function beacuse the event loop are waiting to the connection and stay in stuck mode. it should be async!!!
Thanks a lot, Royi