node-jdbc icon indicating copy to clipboard operation
node-jdbc copied to clipboard

node.js stuck on reserve

Open royigoldi opened this issue 7 years ago • 0 comments

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

royigoldi avatar Jan 24 '19 10:01 royigoldi