Open
Description
All of my queries include dbConnection.release(), however the connections do not get released and once connectionLimit is reached, the execution pauses waiting for an available connection.
I've re-worked my code so that every pool.getConnection() has a dbConnection.release() right next to it, to make absolutely certain that I'm not accidentally leaving any connections unreleased.
However, this did not help, and it seems that there is a bug in the releasing of pool connections.
I store my pool in a static variable with a class called Global.
class globals
{
static dbPool = null;
}
Runs once on startup
globals.dbPool = await mysql.createPool({
host: databaseServer,
port: databasePort,
user: databaseUsername,
password: databasePassword,
database: databaseName,
connectionLimit: 10
});
Example usage
const dbConnection = await globals.dbPool.getConnection();
let mysqlResponse = null;
await dbConnection.query(`SELECT * FROM guild;`).then(result => {
mysqlResponse = result[0];
}).catch(err => console.log(err));
dbConnection.release();
Result after some queries have been executed

Metadata
Metadata
Assignees
Labels
No labels