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

Update MS SQL JDBC driver to 11.2.0.jre11 #24010

Merged

Conversation

sschu
Copy link
Contributor

@sschu sschu commented Feb 28, 2022

Fixes #24009

@quarkus-bot quarkus-bot bot added area/dependencies Pull requests that update a dependency file area/hibernate-orm Hibernate ORM area/persistence labels Feb 28, 2022
@sschu
Copy link
Contributor Author

sschu commented Feb 28, 2022

I ran the MS SQL integration test locally without any problem.

bom/application/pom.xml Outdated Show resolved Hide resolved
@gastaldi
Copy link
Contributor

gastaldi commented Feb 28, 2022

@sschu The PR comment must be changed to Fixes #24009

Also, make sure the commit message is more readable, something like:

Update MS SQL JDBC driver to 10.2.0.jre11

Fixes #24009

@Sanne
Copy link
Member

Sanne commented Feb 28, 2022

I'll be surprised if this works in native w/o further changes, but I'll be happy to be proven wrong.. let's see what CI says about it.

@Sanne Sanne added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Feb 28, 2022
@gastaldi
Copy link
Contributor

I wonder if #23933 may help

@sschu sschu force-pushed the 24009-update-ms-sql-jdbc-driver-to-10.2.0 branch from e710d75 to e6d1b97 Compare February 28, 2022 14:46
@sschu sschu changed the title 24009 update MS SQL JDBC driver to 10.2.0 Fixes #24009 Feb 28, 2022
@sschu
Copy link
Contributor Author

sschu commented Feb 28, 2022

Fixed comments, thanks.

@gastaldi gastaldi changed the title Fixes #24009 Update MS SQL JDBC driver to 10.2.0.jre11 Feb 28, 2022
@famod
Copy link
Member

famod commented Feb 28, 2022

Hi @Sanne! Any reason why this is not covered by dependabot? The other drivers are...

@gsmet
Copy link
Member

gsmet commented Feb 28, 2022

IIRC, the reason we haven't upgraded yet is that making the new driver work in native is not trivial and require some involved work. But we will see what CI has to say.

Hi @Sanne! Any reason why this is not covered by dependabot? The other drivers are...

Yes, because Dependabot upgrades to the jre17 flavor. And I haven't found a way to properly filter things.

@famod
Copy link
Member

famod commented Feb 28, 2022

Ugh...I see. People really need to stop using "classifiers" in versions.

@gastaldi gastaldi removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Feb 28, 2022
@gastaldi
Copy link
Contributor

Apparently this change does not work when building to Native. Some juggling with the GraalVM substitutions may be required

@sschu
Copy link
Contributor Author

sschu commented Feb 28, 2022

Unfortunately. :( I only tested the MS SQL integration test and that went fine. I probably lack the skills to fix things with the native build. However, I will give #23933 a try...

@gastaldi
Copy link
Contributor

@sschu I may be wrong, but after having a quick look at the sources, it seems that #23933 is no longer necessary with this update

@quarkus-bot

This comment has been minimized.

@sschu
Copy link
Contributor Author

sschu commented Mar 1, 2022

Why would it not be necessary anymore? In any case, it did not help. Running the native integration tests I get:
Error: Could not find target method: private void io.quarkus.jdbc.mssql.runtime.graal.com.microsoft.sqlserver.jdbc.QuarkusSQLServerConnection.validateAdalLibrary(java.lang.String) com.oracle.svm.core.util.UserError$UserException: Could not find target method: private void io.quarkus.jdbc.mssql.runtime.graal.com.microsoft.sqlserver.jdbc.QuarkusSQLServerConnection.validateAdalLibrary(java.lang.String) at com.oracle.svm.core.util.UserError.abort(UserError.java:73) at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.findOriginalMethod(AnnotationSubstitutionProcessor.java:751) at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.handleMethodInAliasClass(AnnotationSubstitutionProcessor.java:368) at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.handleAliasClass(AnnotationSubstitutionProcessor.java:340) at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.handleClass(AnnotationSubstitutionProcessor.java:310) at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.init(AnnotationSubstitutionProcessor.java:266) at com.oracle.svm.hosted.NativeImageGenerator.createAnnotationSubstitutionProcessor(NativeImageGenerator.java:889) at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:816) at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:534) at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:494) at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:426) at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:587) at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:126) at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:617)
Which doesn't tell me anything. I would be willing to invest some time here, but any pointers to what might be the problem are appreciated.

@gastaldi
Copy link
Contributor

gastaldi commented Mar 1, 2022

Because the class/method the substitution is referring to no longer exists in this update

@sschu
Copy link
Contributor Author

sschu commented Mar 3, 2022

@gastaldi I played with this a little bit and by adapting substitutions to the new classes, I could make some progress. I also had to add more dependencies like azure-core. Another option I was presented is to provide a flag for classes to load dynamically. I am just missing a guidance on when should I actually add substitution to not trigger more code loading, dynamic loading or actually adding more dependencies...

@gastaldi
Copy link
Contributor

gastaldi commented Mar 4, 2022

Yeah, it's not a trivial task. In my experience, I usually achieve that by trial and error attempts.

@gsmet
Copy link
Member

gsmet commented Mar 14, 2022

@sschu maybe rebase what you have and share it? Even if not finished, somebody might have a look and provide useful insights.

Thanks!

@sschu
Copy link
Contributor Author

sschu commented Mar 16, 2022

I am a bit busy atm, will do on Friday...

@sschu sschu force-pushed the 24009-update-ms-sql-jdbc-driver-to-10.2.0 branch from e6d1b97 to 5aaa643 Compare March 20, 2022 15:39
@sschu
Copy link
Contributor Author

sschu commented Mar 20, 2022

So I played around with this a little bit. I had an intermediate state where things only worked if I add azure-core as dependency. But then things got messy with netty dependencies being added and a conflict where it was declared as initialize-at-runtime in one place and initialize-at-buildtime at another. Surprisingly, it now seems to work also without azure-core- at least the native image build. However, the integration test itself does not succeed anymore - but it also doesn't work for me in main. Its getting a connection reset during the integration test. Not sure where this comes from. @gsmet @gastaldi Maybe you can give it a try if the integration test works for you?

@sschu sschu force-pushed the 24009-update-ms-sql-jdbc-driver-to-10.2.0 branch from c0fe94b to 912bfb4 Compare May 4, 2022 15:52
@gastaldi
Copy link
Contributor

gastaldi commented May 4, 2022

Long-term it would be nicer to actually support the disabled features
👍🏻

However, I think the correct place to put these things is the native-image.properties in the mssql-jdbc repository, not quarkus additional build args in the integration test for ms sql driver in quarkus, right?

I am not 100% sure if Quarkus uses the native-image.properties, I think this feature was disabled some time ago

@Sanne
Copy link
Member

Sanne commented May 4, 2022

We don't generally disable native-image.properties althought we had to do so in particular circumstances, as people have been adding directives into the libraries and sometimes make mistakes, or are compatible only with a very particular version of GraalVM. So adding directives into the libraries has some drawbacks.

In particular if you enable all features of a library and hard code this, then it becomes much bigger, less optimised code, and also amplifies the compilation times. So that's why in Quarkus we prefer to have "knobs" (the build items) so that we can enable/disable the particular features a developer is needing.

But it makes sense for some essential features to be enabled directly in the native-image.properties; for example if there's some reflection need that is always going to be needed for every user of the library, then it's useful to include it in the library.

We're actually having conversations with the GraalVM engineering team about this very topic, wondering how we can help libraries but also without the performance hit; hopefully we'll be able to figure out some way to provide a vendor neutral / standardized approach similar to what Quarkus does, so that metadata can be included within the libraries without making them less "light" when features are not used.

@sschu
Copy link
Contributor Author

sschu commented May 4, 2022

@Sanne Got it. However, that means everybody trying to build a native image would have to come up with the same list of classes to be initialized at runtime I used for the mssql integration test? Worse even, his list could look a bit different if it uses different code-paths? And therefore using native-image properties could at least provide some baseline?

@sschu sschu force-pushed the 24009-update-ms-sql-jdbc-driver-to-10.2.0 branch from 912bfb4 to 60ab59b Compare August 12, 2022 10:36
@sschu sschu changed the title Update MS SQL JDBC driver to 10.2.0.jre11 Update MS SQL JDBC driver to 12.2.0.jre11 Aug 12, 2022
@sschu sschu marked this pull request as ready for review August 12, 2022 10:37
@sschu
Copy link
Contributor Author

sschu commented Aug 12, 2022

@Sanne @gastaldi Since the MS SQL driver is finally released, I updated this PR accordingly for version 11.2.0. Can you please give the CI a go? I currently have docker problems running the CI locally.

@sschu sschu force-pushed the 24009-update-ms-sql-jdbc-driver-to-10.2.0 branch from 60ab59b to 8f92b01 Compare August 12, 2022 11:07
@sschu sschu changed the title Update MS SQL JDBC driver to 12.2.0.jre11 Update MS SQL JDBC driver to 11.2.0.jre11 Aug 12, 2022
@quarkus-bot

This comment has been minimized.

Copy link
Member

@Sanne Sanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work - excellent, thanks!

Fixes quarkusio#24009

Co-authored-by: George Gastaldi <gegastaldi@gmail.com>
@Sanne Sanne force-pushed the 24009-update-ms-sql-jdbc-driver-to-10.2.0 branch from 8f92b01 to 301654e Compare August 15, 2022 09:26
@Sanne
Copy link
Member

Sanne commented Aug 15, 2022

rebased the PR and removed the no longer applicable comment about adal4j from the pom.xml

@sschu
Copy link
Contributor Author

sschu commented Aug 15, 2022

Thanks a lot!

@Sanne Sanne added triage/waiting-for-ci Ready to merge when CI successfully finishes kind/enhancement New feature or request release/noteworthy-feature and removed area/hibernate-orm Hibernate ORM labels Aug 15, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Aug 15, 2022

Failing Jobs - Building 301654e

Status Name Step Failures Logs Raw logs
JVM Tests - JDK 11 Build Failures Logs Raw logs
JVM Tests - JDK 11 Windows Build Failures Logs Raw logs
JVM Tests - JDK 17 Build Failures Logs Raw logs
JVM Tests - JDK 18 Build Failures Logs Raw logs
Native Tests - HTTP Build Failures Logs Raw logs

Full information is available in the Build summary check run.

Failures

⚙️ JVM Tests - JDK 11 #

- Failing: integration-tests/rest-client integration-tests/smallrye-context-propagation 

📦 integration-tests/rest-client

io.quarkus.it.rest.client.selfsigned.ExternalSelfSignedTestCase.should_accept_self_signed_certs line 20 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

io.quarkus.it.rest.client.selfsigned.ExternalSelfSignedTestCase.should_accept_self_signed_certs_java_url line 29 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

io.quarkus.it.rest.client.trustall.ExternalTlsTrustAllTestCase.restClient line 20 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

io.quarkus.it.rest.client.wronghost.ExternalWrongHostTestCase.restClient line 22 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

📦 integration-tests/smallrye-context-propagation

io.quarkus.context.test.SimpleContextPropagationTest.testArcMEContextPropagationDisabled line 83 - More details - Source on GitHub

org.opentest4j.AssertionFailedError: expected: <2> but was: <1>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)

⚙️ JVM Tests - JDK 11 Windows #

- Failing: integration-tests/rest-client 

📦 integration-tests/rest-client

io.quarkus.it.rest.client.selfsigned.ExternalSelfSignedTestCase.should_accept_self_signed_certs line 20 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

io.quarkus.it.rest.client.selfsigned.ExternalSelfSignedTestCase.should_accept_self_signed_certs_java_url line 29 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

io.quarkus.it.rest.client.trustall.ExternalTlsTrustAllTestCase.restClient line 20 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

io.quarkus.it.rest.client.wronghost.ExternalWrongHostTestCase.restClient line 22 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

⚙️ JVM Tests - JDK 17 #

- Failing: extensions/smallrye-reactive-messaging-kafka/deployment integration-tests/rest-client 
! Skipped: integration-tests/kafka-oauth-keycloak integration-tests/kafka-sasl-elytron integration-tests/kubernetes/quarkus-standard-way-kafka and 3 more

📦 extensions/smallrye-reactive-messaging-kafka/deployment

io.quarkus.smallrye.reactivemessaging.kafka.deployment.testing.KafkaDevServicesContinuousTestingTestCase.testContinuousTestingScenario2 line 83 - More details - Source on GitHub

org.awaitility.core.ConditionTimeoutException: Failed to wait for test run 4 State{lastRun=3, running=true, inProgress=true, run=1, passed=0, failed=1, skipped=0, isBrokenOnly=false, isTestOutput=false, isInstrumentationBasedReload=false, isLiveReload=true}
	at io.quarkus.test.ContinuousTestingTestUtils.waitForNextCompletion(ContinuousTestingTestUtils.java:44)
	at io.quarkus.smallrye.reactivemessaging.kafka.deployment.testing.KafkaDevServicesContinuousTestingTestCase.testContinuousTestingScenario2(KafkaDevServicesContinuousTestingTestCase.java:83)

📦 integration-tests/rest-client

io.quarkus.it.rest.client.selfsigned.ExternalSelfSignedTestCase.should_accept_self_signed_certs line 20 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

io.quarkus.it.rest.client.selfsigned.ExternalSelfSignedTestCase.should_accept_self_signed_certs_java_url line 29 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

io.quarkus.it.rest.client.trustall.ExternalTlsTrustAllTestCase.restClient line 20 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

io.quarkus.it.rest.client.wronghost.ExternalWrongHostTestCase.restClient line 22 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

⚙️ JVM Tests - JDK 18 #

- Failing: extensions/smallrye-reactive-messaging-kafka/deployment integration-tests/rest-client 
! Skipped: integration-tests/kafka-oauth-keycloak integration-tests/kafka-sasl-elytron integration-tests/kubernetes/quarkus-standard-way-kafka and 3 more

📦 extensions/smallrye-reactive-messaging-kafka/deployment

io.quarkus.smallrye.reactivemessaging.kafka.deployment.testing.KafkaDevServicesContinuousTestingTestCase.testContinuousTestingScenario2 line 87 - More details - Source on GitHub

org.awaitility.core.ConditionTimeoutException: Failed to wait for test run 5 State{lastRun=4, running=true, inProgress=true, run=1, passed=0, failed=1, skipped=0, isBrokenOnly=false, isTestOutput=false, isInstrumentationBasedReload=false, isLiveReload=true}
	at io.quarkus.test.ContinuousTestingTestUtils.waitForNextCompletion(ContinuousTestingTestUtils.java:44)
	at io.quarkus.smallrye.reactivemessaging.kafka.deployment.testing.KafkaDevServicesContinuousTestingTestCase.testContinuousTestingScenario2(KafkaDevServicesContinuousTestingTestCase.java:87)

📦 integration-tests/rest-client

io.quarkus.it.rest.client.selfsigned.ExternalSelfSignedTestCase.should_accept_self_signed_certs line 20 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

io.quarkus.it.rest.client.selfsigned.ExternalSelfSignedTestCase.should_accept_self_signed_certs_java_url line 29 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

io.quarkus.it.rest.client.trustall.ExternalTlsTrustAllTestCase.restClient line 20 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

io.quarkus.it.rest.client.wronghost.ExternalWrongHostTestCase.restClient line 22 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

⚙️ Native Tests - HTTP #

- Failing: integration-tests/rest-client 

📦 integration-tests/rest-client

io.quarkus.it.rest.client.selfsigned.ExternalSelfSignedITCase.should_accept_self_signed_certs - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

io.quarkus.it.rest.client.selfsigned.ExternalSelfSignedITCase.should_accept_self_signed_certs_java_url - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

io.quarkus.it.rest.client.trustall.ExternalTlsTrustAllIT.restClient - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

io.quarkus.it.rest.client.wronghost.ExternalWrongHostIT.restClient - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

@Sanne
Copy link
Member

Sanne commented Aug 15, 2022

Looks like CI is in trouble, but these failing tests are unrelated. I'll merge.
Thanks all!

@Sanne Sanne merged commit bccd9a1 into quarkusio:main Aug 15, 2022
@quarkus-bot quarkus-bot bot added this to the 2.12 - main milestone Aug 15, 2022
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Aug 15, 2022
@Sanne
Copy link
Member

Sanne commented Aug 15, 2022

Related: hibernate/hibernate-orm#5209

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dependencies Pull requests that update a dependency file area/persistence kind/enhancement New feature or request release/noteworthy-feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update MS SQL JDBC driver to version 10.2.0
6 participants