Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error: This socket has been ended by the other party #1302

Closed
greedThread opened this issue Mar 11, 2021 · 5 comments
Closed

Error: This socket has been ended by the other party #1302

greedThread opened this issue Mar 11, 2021 · 5 comments

Comments

@greedThread
Copy link

Hi.

When the current connection pool is being used and the server is idle for a long time, the error "Error: This socket has been ended by the other party" occurs.

As expected, it seems to be caused by a network error when the windows10 is in sleep state.

Is there a solution to this phenomenon?

I'm sorry for my inexperienced English.

@greedThread
Copy link
Author

Error: This socket has been ended by the other party

On 'commit' or'rollback' after error Another error has occurred.

Error: Can't add new command when connection is in closed state
at PoolConnection._addCommandClosedState (\node_modules\mysql2\lib\connection.js:137:17)
at PoolConnection.query (\node_modules\mysql2\lib\connection.js:510:17)
at PoolConnection.rollback (\node_modules\mysql2\lib\connection.js:667:17)

@sidorares
Copy link
Owner

@greedThread try enableKeepAlive: true config option

See #683 (comment) and #1081

@sidorares
Copy link
Owner

we should probably make it default option. Currently when remote side closes the socket the client might not see it, see net.setKeepAlive

@greedThread
Copy link
Author

The quick answer was helpful. Thank you.

@greedThread
Copy link
Author

enableKeepAlive: true config option

I would be happy if you add it to ReadMe.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants