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

Broken logic in ConfigurableRetryLogic #2578

Open
debedb opened this issue Jan 8, 2025 · 3 comments · May be fixed by #2579
Open

Broken logic in ConfigurableRetryLogic #2578

debedb opened this issue Jan 8, 2025 · 3 comments · May be fixed by #2579
Assignees
Labels
Under Review Used for pull requests under review

Comments

@debedb
Copy link

debedb commented Jan 8, 2025

Driver version

12.9.0

SQL Server version

N/A

Client Operating System

Amazon Linux

JAVA/JVM version

11

Table schema

N/A

Problem

When run out of a folder such as /var/task, for example (in AWS lambda), the following occurs:

2025-01-08 00:44:39 67a87119-0069-48d8-90ad-5de8e2a32ee0 WARN  CompositeHandler:126 - handleRequest: Completed with an exception.
java.lang.StringIndexOutOfBoundsException: begin 0, end -6, length 10
at java.lang.String.checkBoundsBeginEnd(Unknown Source) ~[?:?]
at java.lang.String.substring(Unknown Source) ~[?:?]
at com.microsoft.sqlserver.jdbc.ConfigurableRetryLogic.getCurrentClassPath(ConfigurableRetryLogic.java:290) ~[task/:?]

This is due to hardcoded substring logic.

@github-project-automation github-project-automation bot moved this to To be triaged in MSSQL JDBC Jan 8, 2025
@debedb debedb changed the title Broken logic in ConfigurableRetry logic Broken logic in ConfigurableRetryLogic Jan 8, 2025
@machavan machavan self-assigned this Jan 9, 2025
@machavan machavan added the Under Investigation Used for issues under investigation label Jan 9, 2025
@machavan
Copy link
Contributor

machavan commented Jan 9, 2025

Hi @debedb

Thank you for reporting this issue. We are looking to address it.

As a temporary workaround, could you try to put the driver jar in a path that is longer than 16 characters. Also, was the mssql-jdbc driver jar file name renamed to a shorter name in your case?

@debedb
Copy link
Author

debedb commented Jan 9, 2025

Hi @machavan

[SORRY EDITED: Hit save before I finished, flagging with comment]

As a temporary workaround I just did this from my end (there's no need to search for the properties inside the driver anyway in this case): debedb@bc16e15#diff-432635069536b5052b4fffe63d32f62edd8f967ee01a917b3e4729d3c1c1a7ce

I think I understand why that magic of 16 characters was there (backtracking from running in an IDE. The problem is that it breaks in issues like awslabs/aws-athena-query-federation#2510 but seems only if the directory name is long enough.

@Jeffery-Wasty Jeffery-Wasty linked a pull request Jan 9, 2025 that will close this issue
@machavan machavan assigned Jeffery-Wasty and unassigned machavan Jan 10, 2025
@Jeffery-Wasty
Copy link
Contributor

Hi @debedb,

Apologies for the above oversight. I have linked a PR that I believe will resolve this issue. We'll look to get it into a release asap.

@Jeffery-Wasty Jeffery-Wasty moved this from To be triaged to In progress in MSSQL JDBC Jan 10, 2025
@Jeffery-Wasty Jeffery-Wasty added Under Review Used for pull requests under review and removed Under Investigation Used for issues under investigation labels Jan 10, 2025
@machavan machavan moved this from In progress to Under Peer Review in MSSQL JDBC Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Under Review Used for pull requests under review
Projects
Status: Under Peer Review
Development

Successfully merging a pull request may close this issue.

3 participants