-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix Spring Data Cosmos not work JDK 16 #31417
Fix Spring Data Cosmos not work JDK 16 #31417
Conversation
cd92028
to
be6141a
Compare
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
be6141a
to
953dfaa
Compare
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
69796fc
to
bd4b2a2
Compare
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
bd4b2a2
to
8045613
Compare
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
8045613
to
32c3a4c
Compare
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
32c3a4c
to
dd3bbd9
Compare
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
dd3bbd9
to
06db49f
Compare
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -33,8 +33,7 @@ | |||
"ProfileFlag": "-Pe2e", | |||
"Agent": { | |||
"ubuntu": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } | |||
}, | |||
"JavaTestVersion": "1.11" | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alzimmermsft , I am wondering what other azure SDKs are testing against?
@saragluna - while supporting java version 16 or 17 is good to have, but we should still aim to test our cosmos Java SDKs with at least 8 and 11. (since most of our customers are on version 8 and 11).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ci pipeline will run against Java 8 and Java 11, the live tests pipeline will use Java 17. I found this https://github.com/Azure/azure-sdk-for-java/blob/main/eng/pipelines/templates/stages/platform-matrix.json, but @alzimmermsft could help confirm it.
The problem is whether we should run the live tests against JDK8, JDK 11, and JDK 17.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thanks for the information @saragluna , let's confirm with @alzimmermsft
Also, I am seeing some issue on spring live tests - https://dev.azure.com/azure-sdk/internal/_build/results?buildId=1927553&view=logs&j=caa02ea9-2389-5ab0-dd04-e2bf1c48642e&t=2c713f32-d936-5c8d-942a-fcedc5ff7533&l=43
will investigate it tomorrow and will hopefully unblock this PR and prepare for merge, thanks for the patience!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, looks like there are more errors related to some java modules I think - https://dev.azure.com/azure-sdk/internal/_build/results?buildId=1927553&view=ms.vss-test-web.build-test-results-tab&runId=36095886&paneView=debug&resultId=100160
@saragluna can you please do a sanity check and see if these are also related to JDK 17 ? (Since these are in live CI tests).
also wondering, if we really need to update live CI for azure-cosmos java SDK? May be we should just limit the live CI to JDK 17 to just spring data cosmos if we need it for spring boot 3 support, thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the error is related to JDK 17 since it's using the reflection. Since spring-data-cosmos depends on azure-cosmos, so for spring-data-cosmos to support JDK 17, we should ensure that azure-cosmos supports it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kushagraThapar, @saragluna, a majority of the CI pipelines are primarily testing against Java 8 and Java 17 with some testing against Java 11, the live test pipelines are more of a full mix where Java 8, 11, and 17 are represented fairly equally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @alzimmermsft , can you please help us with the appropriate Java version testing? Please feel free to make edits / updates to this PR to allow supporting and testing Java 8, 11 and 17.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gladly, the current base matrix for CI for all com.azure
SDKs is
- Each OS tests against Java 8
- One Linux run against Java 11 as a sanity check
- Each OS tests against Java 17
Some of the runs are slightly specialized but that's the rough breakdown.
OS | Java 8 | Java 11 | Java 17 |
---|---|---|---|
Linux | x | x | x |
macOS | x | x | |
Windows | x | x |
Java 11 may be reintroduced as an all OS run again in the future if needed.
@alzimmermsft I made some changes to the CI pipeline, can you please help review them? |
This is great, I'm really happy to see the replace statements get removed. |
Thanks @benbp , please review the PR from eng point of view. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to Java versions ran look good to me
@benbp / @alzimmermsft looks like the lib/security folder is different on java 8 vs java 17. And hence the step that adds emulator certificate is failing. This is the script - which has a fixed path for security folder inside java home ->
for |
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
Yeah, this changed somewhere between Java 8 and Java 11. The way I would go about this is using:
Test if the Java 8 path exists and use it, else test the Java 11+ path exists and use it, otherwise write a nice error of what went wrong. Edit It was brought to my attention that I forgot
Edit by Kushagra Thapar On offline debugging, we found out the typo, the below script refers to the correct one :)
|
sdk/cosmos/integration-matrix.json
Outdated
{ | ||
"matrix": { | ||
"Cosmos": { | ||
"Session_Integration": { | ||
"Session_Integration_8": { | ||
"ArmTemplateParameters": "@{ enableMultipleWriteLocations = $false; defaultConsistencyLevel = 'Session' }", | ||
"ProfileFlag": "-P integration-test-azure", | ||
"Pool": "azsdk-pool-mms-ubuntu-2004-general", | ||
"OSVmImage": "MMSUbuntu2004", | ||
"JavaTestVersion": "1.8" | ||
}, | ||
"Session_Integration_11": { | ||
"ArmTemplateParameters": "@{ enableMultipleWriteLocations = $false; defaultConsistencyLevel = 'Session' }", | ||
"ProfileFlag": "-P integration-test-azure", | ||
"Pool": "azsdk-pool-mms-ubuntu-2004-general", | ||
"OSVmImage": "MMSUbuntu2004", | ||
"JavaTestVersion": "1.11" | ||
}, | ||
"Session_Integration_17": { | ||
"ArmTemplateParameters": "@{ enableMultipleWriteLocations = $false; defaultConsistencyLevel = 'Session' }", | ||
"ProfileFlag": "-P integration-test-azure", | ||
"Pool": "azsdk-pool-mms-ubuntu-2004-general", | ||
"OSVmImage": "MMSUbuntu2004", | ||
"JavaTestVersion": "1.17" | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This matrix will be easier to read and maintain if you de-duplicate the config entries:
{
"matrix": {
"cosmos": {
"Session_Integration": {
"ArmTemplateParameters": "@{ enableMultipleWriteLocations = $false; defaultConsistencyLevel = 'Session' }",
"ProfileFlag": "-P integration-test-azure",
"Pool": "azsdk-pool-mms-ubuntu-2004-general",
"OSVmImage": "MMSUbuntu2004"
}
},
"JavaTestVersion": ["1.8", "1.11", "1.17"]
}
}
One comment on optimizing the integration matrix, otherwise configs look good. |
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @saragluna for the fix.
/check-enforcer override |
Description
Fixes #31205, #28926. Unblocks #30458.
Due to JEP 396: Strongly Encapsulate JDK Internals by Default, now if
MappingContext
try to reflect theUUID
,java.time
orjava.lang
classes, it will throwInaccessibleObjectException
.This PR will add a
CosmsoSimpleTypes
to markUUID
as a a simple type, which will skip the reflection.@kushagraThapar made some changes to the ci/live pipeline, the Java versions with ci/live would be according to him:
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines