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

Fix compatibility with Node.js 12.4 and newer #932

Merged
merged 2 commits into from
Jul 31, 2019

Conversation

arthurschreiber
Copy link
Collaborator

SQL Server expects individual TLS segments to never contain more data than the negotiated TDS packet size. If this is not the case, SQL Server will simply drop the connection without warning.

Since Node.js 12.4, TLSSockets try to fit as much data as possible into a TLS fragment. Because the default TLS fragment size is 16384 bytes, and this does not necessarily match the negotiated TDS packet size, users of Node.js 12.4 and newer would encounter sudden connection drops (e.g. when sending large queries).

By keeping the TLS fragment size and the negoitated TDS packet size in sync, we can make sure SQL Server does not drop the connection.

Fixes: #923

@arthurschreiber arthurschreiber requested a review from a team July 31, 2019 17:56
SQL Server expects individual TLS segments to never contain more data than the negotiated TDS packet size. If this is not the case, SQL Server will simply drop the connection without warning.

Since Node.js 12.4, `TLSSocket`s try to fit as much data as possible into a TLS fragment. Because the default TLS fragment size is `16384` bytes, and this does not necessarily match the negotiated TDS packet size, users of Node.js 12.4 and newer would encounter sudden connection drops (e.g. when sending large queries).

By keeping the TLS fragment size and the negoitated TDS packet size in sync, we can make sure SQL Server does not drop the connection.
@arthurschreiber arthurschreiber merged commit 9bb7e98 into master Jul 31, 2019
@arthurschreiber arthurschreiber deleted the arthur/fix-node-12-compat branch July 31, 2019 18:50
@arthurschreiber
Copy link
Collaborator Author

🎉 This PR is included in version 6.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

ConnectionError: Connection lost - write ECONNRESET when inserting long string
1 participant