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 ConnectionPool.drain function clears waiting acquire calls. These acquire calls will hang forever. Instead, the waiting requests should timeout immediately (which doesn't seem possible with Timers) or don't clear them and let them timeout.
An easy way to see this is:
`var poolConfig = {
acquireTimeout: 5000 //sorten the timeout to make the example easier to understand
};
The ConnectionPool.drain function clears waiting acquire calls. These acquire calls will hang forever. Instead, the waiting requests should timeout immediately (which doesn't seem possible with Timers) or don't clear them and let them timeout.
An easy way to see this is:
`var poolConfig = {
acquireTimeout: 5000 //sorten the timeout to make the example easier to understand
};
var connectionConfig = {
userName: 'test',
password: 'test',
server: 'bad-server-name',
options: {
appName: 'pool-test',
database: 'test'
}
};
//create the pool
var pool = new ConnectionPool(poolConfig, connectionConfig);
pool.on('error', function(err) {
console.error('Error Event: ' + err.message);
pool.drain();
});
//acquire a connection
pool.acquire(function (err, connection) {
if (err)
// you'll never see this
console.error('Acquire Error: ' + err.message);
});
console.log('done!');`
The text was updated successfully, but these errors were encountered: