Skip to content

SQL Server has closed connection unexpectedly if sql request size more then package size and it is chunked (probably only together with ssl) #1433

@temaleva

Description

@temaleva

Version

At least version 4.x and actual snapshot 5.0.0-SNAPSHOT

Context

By trying to send sql request (especially insert) which exceeds in size current package size

Reproducer

Reproducer quarkus project could be found here https://github.com/eagely/vertx-closed-connection/tree/master

Steps to reproduce

  1. set tds driver package size small enough to be as small as you request size ( for example using quarkus.datasource.reactive.mssql.packet-size property in quarkus based project).
    The minimal package size is 512 , so you request size must be at least 512 bytes.
  2. Try to execute insert statement
  3. Receive ClosedConnectionException instead of answer from sql server.

Extra

It looks like the problem is connected with tls package size, which must be synchronized with request package size.
The same error was detected (and fixed) in several other mssql clients/libraries, such as .NET and Node.js
At least this one looks very similar tediousjs/tedious#923

It could be, that the problem only appeares on linux, but this is also mean in docker env reproducible as well..
Reproducer use sql docker and was started on linux only. (Not know if on windows host the same exception appears).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions