Fix pipeline java - spring sometimes hang in JDK 21 + Ubuntu#48608
Fix pipeline java - spring sometimes hang in JDK 21 + Ubuntu#48608rujche wants to merge 8 commits into
java - spring sometimes hang in JDK 21 + Ubuntu#48608Conversation
…tability" This reverts commit 47cadf1.
java - spring not stable in Java 21
…000)', just like this PR: https://github.com/Azure/azure-sdk-for-java/pull/47990/changes" This reverts commit 6149dd6.
java - spring not stable in Java 21java - spring sometimes hang in JDK 21 + Ubuntu
There was a problem hiding this comment.
Pull request overview
Updates Azure SDK for Java’s Spring CI pipeline configuration to mitigate an intermittent hang observed on JDK 21 + Ubuntu by shifting the JDK 21 test legs to Windows and enabling broader HTTP client coverage in tests.
Changes:
- Enable running tests across all configured HTTP client variants by allowing
AZURE_TEST_*matrix variables to remain set (Spring pipeline opts in). - Move the Java 21 matrix include legs from Ubuntu to Windows in the shared platform matrix to avoid the observed hang.
- Add a new archetype pipeline parameter to control whether
AZURE_TEST_*variables are blanked out during matrix generation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| sdk/spring/ci.yml | Opts Spring CI into the new “test all HTTP clients” behavior. |
| eng/pipelines/templates/stages/platform-matrix.json | Moves Java 21 include jobs from Ubuntu to Windows for multiple HTTP clients. |
| eng/pipelines/templates/stages/archetype-sdk-client.yml | Adds a new parameter and conditionally applies the AZURE_TEST.* matrix replacement. |
Comments suppressed due to low confidence (1)
eng/pipelines/templates/stages/platform-matrix.json:128
- Moving the Java 21 include legs off Linux means CI will no longer exercise Java 21 on Ubuntu at all via this matrix. If Linux+Java 21 coverage is still desired, consider adding a separate non-blocking/scheduled Linux leg (or using a different Ubuntu image) rather than removing the Linux dimension entirely.
"Agent": {
"windows-2022": { "OSVmImage": "env:WINDOWSVMIMAGE", "Pool": "env:WINDOWSPOOL" }
},
"JavaTestVersion": "1.21",
"AZURE_TEST_HTTP_CLIENTS": "VertxHttpClientProvider",
"Options": {
| "Agent": { | ||
| "ubuntu-24.04": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } | ||
| "windows-2022": { "OSVmImage": "env:WINDOWSVMIMAGE", "Pool": "env:WINDOWSPOOL" } | ||
| }, | ||
| "JavaTestVersion": "1.21", | ||
| "AZURE_TEST_HTTP_CLIENTS": "netty", |
There was a problem hiding this comment.
platform-matrix.json is the default matrix config used by the shared archetype-sdk-client.yml template, so changing the Java 21 include entries from Ubuntu to Windows will shift Java 21 CI coverage to Windows for all service directories using the archetype (not just Spring). If the hang is Spring-specific, consider scoping this by using a Spring-only matrix override (e.g., a Spring-specific matrix file referenced from sdk/spring/ci.yml via MatrixConfigs/AdditionalMatrixConfigs) instead of modifying the global matrix.
| - name: MatrixReplace | ||
| type: object | ||
| default: [] | ||
| - name: testAllHttpClients |
There was a problem hiding this comment.
testAllHttpClients is the only parameter in this template using lowerCamelCase; all other parameters use PascalCase (e.g., TestPipeline, MatrixReplace, TestParallelization). For consistency and discoverability, rename this to TestAllHttpClients (and update all call sites).
| - name: testAllHttpClients | |
| - name: TestAllHttpClients |
|
|
||
| - AZURE_TEST.*=.*/ | ||
| - ${{ if ne(parameters.testAllHttpClients, true) }}: | ||
| - AZURE_TEST.*=.*/ |
There was a problem hiding this comment.
The flag name suggests it only affects HTTP-client testing, but the replacement being toggled is AZURE_TEST.*=.*/, which will blank out any AZURE_TEST* matrix parameter (present or future), not just AZURE_TEST_HTTP_CLIENTS. Either narrow the replacement key regex to AZURE_TEST_HTTP_CLIENTS or rename the flag to reflect that it preserves all AZURE_TEST* variables.
| - AZURE_TEST.*=.*/ | |
| - AZURE_TEST_HTTP_CLIENTS=.*/ |
| releaseInBatch: ${{ parameters.release_springcloudazurestartermonitor }} | ||
| TestParallelization: '1' | ||
| testAllHttpClients: true | ||
| MatrixFilters: |
There was a problem hiding this comment.
This new parameter follows the lowerCamelCase name introduced in the archetype template. If the archetype parameter is renamed to PascalCase for consistency (recommended), update this key accordingly so the value is actually applied.
| MatrixFilters: | |
| matrixFilters: |
|
Closing this PR in favor of #48622 |



java - springsometimes hang inJDK 21 + Ubuntu.testAllHttpClientsto confirm that it's not cause by http client type: netty / jdk / vertx.JDK 21's OS fromubuntutowindows, problem disappear. Root cause is unknown. Maybe it's a problem in the OS environment.