Skip to content

The driver connects to the wrong SQLServer host #1964

@mmimica

Description

@mmimica

Driver version

11.2.1

Client Operating System

Linux

Problem description

When the database driver is used to connect to different SQLServer hosts, it can happen that the TCP connection is established to the wrong host. This is due to a race-condition in com.microsoft.sqlserver.jdbc.SocketFinder#getSocketByIPPreference. The change was introduced in #1766.

com.microsoft.sqlserver.jdbc.SocketFinder#addressList is static, and this state is shared across all SQLServerConnection instances, even if connected to different SQLServer hosts. A race-condition when mutating this state in com.microsoft.sqlserver.jdbc.SocketFinder#getSocketByIPPreference can lead to the socked being connected to an unexpected host.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in the driver. A high priority item that one can expect to be addressed quickly.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions