Skip to content
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: TCP KeepAlive issue #2389

Open
bertho-zero opened this issue Aug 12, 2020 · 2 comments
Open

ECONNRESET: TCP KeepAlive issue #2389

bertho-zero opened this issue Aug 12, 2020 · 2 comments
Labels

Comments

@bertho-zero
Copy link

I have an ECONNRESET problem every X minutes, by default node does not activate KeepAlive on the socket (https://nodejs.org/api/net.html#net_socket_setkeepalive_enable_initialdelay)

It is possible to pass an optional socket but a solution as proposed in #2110 seems more suitable.

I saw #566, #878 and #1939

What do you think is the approach to take?

@bertho-zero
Copy link
Author

It seems that we can pass a socket option:

this._socket = options.socket;

But this one is replaced during the connect:

mysql/lib/Connection.js

Lines 74 to 76 in dbb07ed

this._socket = (this.config.socketPath)
? Net.createConnection(this.config.socketPath)
: Net.createConnection(this.config.port, this.config.host);

@dougwilson
Copy link
Member

Yea, providing a socket option does nothing and it's really desired at this time with how the module works. Instead a config option will be added to enable / control the TCP keep alive on the socket that is created, similar to the referenced PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants