-
-
Notifications
You must be signed in to change notification settings - Fork 618
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
ECONNRESET when closing SSL connection not being handled to NodeJS Error spec #1543
Comments
@sidorares Is the fix planned for release anytime soon to NPM? If not, is there a reason? |
Just met this one myself. Thankfully the patch-package utility exists so I can fix it for my codebase and move on. Here's my patch: diff --git a/node_modules/mysql2/lib/connection.js b/node_modules/mysql2/lib/connection.js
index 47970e9..4704db5 100644
--- a/node_modules/mysql2/lib/connection.js
+++ b/node_modules/mysql2/lib/connection.js
@@ -174,7 +174,7 @@ class Connection extends EventEmitter {
this.connectTimeout = null;
}
// Do not throw an error when a connection ends with a RST,ACK packet
- if (err.errno === 'ECONNRESET' && this._closing) {
+ if (err.code === 'ECONNRESET' && this._closing) {
return;
}
this._handleFatalError(err); |
That looks useful. I'll have to look into it further. Thanks for the heads up! |
would be good to add an integration test for this |
@sidorares Will this be pushed to NPM? At present I am having to patch the repo via |
Hi there, I receive the following error when closing a SSL connection that bubbles up:
I've narrowed it down to the following lines that are mishandling the exception thrown:
Issue seems to be that it's looking for
err.errno
as a string. However,errno
has exclusively been a negative number since Node 13, witherr.code
being the string that would emitECONNRESET
.I see that this has been fixed in master. Can this please be released to npm?
The text was updated successfully, but these errors were encountered: