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

NullPointerException on reconnect with lockTimeout configured #2353

Closed
HeinzHuberRsg opened this issue Mar 19, 2024 · 5 comments · Fixed by #2368
Closed

NullPointerException on reconnect with lockTimeout configured #2353

HeinzHuberRsg opened this issue Mar 19, 2024 · 5 comments · Fixed by #2368

Comments

@HeinzHuberRsg
Copy link

Driver version

10.2.3 - 12.6.0

SQL Server version

2019

Client Operating System

Windows, Linux

JAVA/JVM version

1.8.0, 17

Table schema

No special schema

Problem description

If an automatic reconnect is triggered and lockTimeout is configured, a NullPointerException is thrown.

Expected behavior

Automatic reconnect works.

Actual behavior

Reconnect fails.

Error message/stack trace

Exception in thread "Thread-0" java.lang.NullPointerException: Cannot invoke "com.microsoft.sqlserver.jdbc.ICounter.increaseCounter(long)" because the return value of "com.microsoft.sqlserver.jdbc.TDSCommand.getCounter()" is null
at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(IOBuffer.java:6880)
at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(IOBuffer.java:8077)
at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(IOBuffer.java:8040)
at com.microsoft.sqlserver.jdbc.SQLServerConnection$1ConnectionCommand.doExecute(SQLServerConnection.java:4260)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7675)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeReconnectCommand(SQLServerConnection.java:4222)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectionCommand(SQLServerConnection.java:4266)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:5163)
at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:5087)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7675)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeReconnect(SQLServerConnection.java:3590)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:3571)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:3172)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:3018)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1836)
at com.microsoft.sqlserver.jdbc.ReconnectThread.run(IdleConnectionResiliency.java:461)

Any other details that can be helpful

JDBC trace logs

jdbc0.zip
The support case 2402210030004759 contains an app to reproduce the problem

@Jeffery-Wasty
Copy link
Contributor

Thank you for providing additional instructions to what was mentioned in 2402210030004759. Since this is the same issue, we will be providing updates in that email thread.

@HeinzHuberRsg
Copy link
Author

Well. The NPE has gone away. But still no reconnect!
Should we file another issue or can this one be reopened?

@Jeffery-Wasty
Copy link
Contributor

Jeffery-Wasty commented Apr 8, 2024

The above reconnection issue is part of a broader series of issues with reconnection/retry with the driver. We plan on releasing larger changes to address all these issues at once. If, following the release, the issue you have above persists, then please open a new issue. However, we do plan on including the above scenario in our test suite for the aforementioned retry changes. We will update this thread when the above changes are released.

@HeinzHuberRsg
Copy link
Author

Thx for the information.
Looking forward to the bigger fixes then ;)

@Jeffery-Wasty
Copy link
Contributor

@HeinzHuberRsg I've continued the discussion at #2438, reserving this closed issue for just the NullPointerException. I have a question though, what connection string options, besides lockTimeout do you have configured? It would be best if you could share your connection string with us.

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

Successfully merging a pull request may close this issue.

2 participants