Closed bdmason closed 6 years ago
This doesn't look like it's an issue with this library. It'll either be an issue with your mysql server instance or with the mysqljs that promise-mysql wraps.
On Thu, 24 May 2018, 08:12 bdmason, notifications@github.com wrote:
I've got a similar problem to 86 https://github.com/lukeb-uk/node-promise-mysql/issues/86 in that my connection hangs every now and again. I'm exporting my pool and using it in a bunch of routes, so calling pool.end() like 86 did to solve their issue closes the pool before any of the routes can use it.
Every now and again in the mysql error log I get:
[Note] Aborted connection 3018 to db: myDb' user: 'myUsr' host: 'localhost' (Got an error reading communication packets)
My pool is exported like this:
const mysql = require("promise-mysql"); const pool = mysql.createPool({ host: process.env.DB_HOST, user: process.env.DB_USER, password: process.env.DB_PASSWORD, database: process.env.DB_NAME, connectionLimit: 10 }); module.exports = pool;
There are very few mysql connections on the server, and the issue is rare
- one in every several dozen database queries hangs and logs the above error.
I'm on Ubuntu 16.04, and typing mysql --version prints:
mysql Ver 14.14 Distrib 5.7.22, for Linux (x86_64) using EditLine wrapper
And all my databases are InnoDB. I'm struggling to see what I've got wrong. Is there anything in the above that explains why my DB connection is occasionally aborted?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lukeb-uk/node-promise-mysql/issues/90, or mute the thread https://github.com/notifications/unsubscribe-auth/AEjy1MRmgL7gVXrSNmvmM0brain16ZREks5t1l1ZgaJpZM4ULrtp .
Ok I'll close this. It's very odd and if it was a code/package error I'd expect others to have it too.
I've got a similar problem to 86 in that my connection hangs every now and again. I'm exporting my pool and using it in a bunch of routes, so calling pool.end() like 86 did to solve their issue closes the pool before any of the routes can use it.
Every now and again in the mysql error log I get:
My pool is exported like this:
There are very few mysql connections on the server, and the issue is rare - one in every several dozen database queries hangs and logs the above error.
I'm on Ubuntu 16.04, and typing
mysql --version
prints:And all my databases are InnoDB. I'm struggling to see what I've got wrong. Is there anything in the above that explains why my DB connection is occasionally aborted?