Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node.js stuck on reserve #193

Open
royigoldi opened this issue Jan 24, 2019 · 0 comments
Open

node.js stuck on reserve #193

royigoldi opened this issue Jan 24, 2019 · 0 comments

Comments

@royigoldi
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant