-
Notifications
You must be signed in to change notification settings - Fork 95
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
Aborted connection when using ioredis and process.exit(0) #216
Comments
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:
|
we do have a similar setup and similar errors. After moving from mysql2 we have massive problems with pooled connections. Not sure if following fits here or in #239 or in a new bug report.I currently think While "Connections" is rising on every service restart with the number of 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.The text was updated successfully, but these errors were encountered: