Open brenc opened 1 year ago
This is strange, because this kind of error occurs when initiating connection to mariadb server, Server send a 'greeting packet', and connector never sending anything back to server. Server close socket after some time with this type of error.
I would check that there is no firewall between your client and server. (and ensure that assumption with some wireshark logs)
Yes, very strange. This is all on the internal network. No firewalls. I set up and manage the entire environment so I know for sure.
Like I said, it only happens when those conditions are met. Sometimes the connection does get connected and authenticated and I'll see logs like this as well:
[Warning] Aborted connection 36 to db: 'mydb' user: 'mydb' host: '192.168.0.13' (Got an error reading communication packets)
we do have a similar setup and similar errors. After moving from mysql2 we have massive problems with pooled connections.
I currently think pool.end()
does not close all connections, because, when I Query
show status like '%onn%';
I get Results like:
_Abortedconnects: 0
Connections: 10
While "Connections" is rising on every service restart with the number of connectionLimit: 10
. No closed connections or decreasing connection count, even after minutes.
May be the pool only closes active connections, not idle ones?
I'm not sure if this is a bug with this module or what but I thought I'd start by making note of this very strange issue here for future reference. Using Node v16.17.0 and mariadb v3.0.1 inside a Docker container (
node:16-bullseye-slim
).Consider the following ESM:
On exit this causes MariaDB errors like:
[Warning] Aborted connection 632 to db: 'unconnected' user: 'unauthenticated' host: '172.26.0.12' (This connection closed normally without authentication)
It looks like the following conditions have to be met:
ioredis
(perhaps others?) and make a Redis queryprocess.exit(0)
This set of conditions causes aborted connection errors when the script exits.
Workarounds:
process.exit(0)
. I couldn't do this as I need to signal to Bree (the job runner I use) that the job exited successfully. The aborted connection errors happen whether I'm using Bree or not.process.exit(0)
. Even 100ms seems to prevent these errors from occurring. See the commented out sleep above.