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

Exception not immediately thrown after connect failure when connectRetryCount=0 #2232

Closed
bukkfrig opened this issue Oct 9, 2023 · 3 comments · Fixed by #2247 or #2293
Closed

Exception not immediately thrown after connect failure when connectRetryCount=0 #2232

bukkfrig opened this issue Oct 9, 2023 · 3 comments · Fixed by #2247 or #2293
Assignees
Labels
Bug A bug in the driver. A high priority item that one can expect to be addressed quickly.

Comments

@bukkfrig
Copy link

bukkfrig commented Oct 9, 2023

Driver version

Starting in 9.5.0, through current version: 12.4.1.

SQL Server version

Microsoft SQL Server 2019

Client Operating System

Windows Server 2016 Standard

JAVA/JVM version

17

Problem description

Prior to driver version 9.3.0, when we would have a connection failure (for testing, we use "Take offline" at the database), we would get a SQLServerException immediately on trying to connect, and this was the desired behaviour for our application.

After the changes in version 9.3.0 ("added Open Connection Retry"), instead we have to wait for the duration of the "loginTimeout" before getting the SQLServerException. In versions 9.3.0 through 9.4.1 we could remedy this by setting connectRetryCount=0, and again get the desired immediate SQLServerException.

However, after the changes in version 9.5.0 ("Idle Connection Resiliency Feature"), setting the connectRetryCount=0 no longer triggers an immediate exception when the database is offline.

Expected behavior

With connectRetryCount=0, an immediate exception is thrown when connecting to an offline database.

Actual behavior

With connectRetryCount = 0, exception is thrown after 30 seconds (duration of default loginTimeout) when connecting to an offline database.

@bukkfrig
Copy link
Author

bukkfrig commented Oct 9, 2023

Essentially the same as described in #2188.

@Jeffery-Wasty
Copy link
Contributor

Hi @bukkfrig,

We're aware of this issue and are currently working on a solution.

@lilgreenbird lilgreenbird added this to the 12.5.0 milestone Oct 19, 2023
@lilgreenbird lilgreenbird added the Bug A bug in the driver. A high priority item that one can expect to be addressed quickly. label Oct 19, 2023
@Jeffery-Wasty Jeffery-Wasty linked a pull request Nov 7, 2023 that will close this issue
@Jeffery-Wasty
Copy link
Contributor

Retry logic was rewritten in PR 2247, which will be available in driver release 12.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in the driver. A high priority item that one can expect to be addressed quickly.
Projects
Status: Closed Issues
3 participants