Skip to content

Fix pipeline java - spring sometimes hang in JDK 21 + Ubuntu#48608

Closed
rujche wants to merge 8 commits into
mainfrom
rujche/main/try-to-fix-pipeline-java-spring-not-stable-in-java-21
Closed

Fix pipeline java - spring sometimes hang in JDK 21 + Ubuntu#48608
rujche wants to merge 8 commits into
mainfrom
rujche/main/try-to-fix-pipeline-java-spring-not-stable-in-java-21

Conversation

@rujche

@rujche rujche commented Mar 27, 2026

Copy link
Copy Markdown
Member
  • Fix pipeline java - spring sometimes hang in JDK 21 + Ubuntu.
  • Add testAllHttpClients to confirm that it's not cause by http client type: netty / jdk / vertx.
  • Update JDK 21's OS from ubuntu to windows, problem disappear. Root cause is unknown. Maybe it's a problem in the OS environment.

@github-actions github-actions Bot added the azure-spring All azure-spring related issues label Mar 27, 2026
@rujche rujche self-assigned this Mar 27, 2026
@rujche rujche added this to the 2026-04 milestone Mar 27, 2026
@rujche rujche changed the title Try to fix pipeline java - spring not stable in Java 21 Try to fix pipeline java - spring not stable in Java 21 Mar 27, 2026
@rujche

rujche commented Mar 27, 2026

Copy link
Copy Markdown
Member Author

Seems it's not caused by netyy:

image

@rujche

rujche commented Mar 27, 2026

Copy link
Copy Markdown
Member Author

The issue didn't happen in JDK 21 + Windows:

image

@rujche rujche changed the title Try to fix pipeline java - spring not stable in Java 21 Fix pipeline java - spring sometimes hang in JDK 21 + Ubuntu Mar 27, 2026
@rujche

rujche commented Mar 27, 2026

Copy link
Copy Markdown
Member Author

Confirmed again: The issue didn't happen in JDK 21 + Windows:

image

@rujche
rujche marked this pull request as ready for review March 27, 2026 11:47
Copilot AI review requested due to automatic review settings March 27, 2026 11:47
@rujche
rujche requested review from alzimmermsft and mrm9084 March 27, 2026 11:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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": {

Comment on lines 93 to 97
"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",

Copilot AI Mar 27, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
- name: MatrixReplace
type: object
default: []
- name: testAllHttpClients

Copilot AI Mar 27, 2026

Copy link

Choose a reason for hiding this comment

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

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).

Suggested change
- name: testAllHttpClients
- name: TestAllHttpClients

Copilot uses AI. Check for mistakes.

- AZURE_TEST.*=.*/
- ${{ if ne(parameters.testAllHttpClients, true) }}:
- AZURE_TEST.*=.*/

Copilot AI Mar 27, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
- AZURE_TEST.*=.*/
- AZURE_TEST_HTTP_CLIENTS=.*/

Copilot uses AI. Check for mistakes.
Comment thread sdk/spring/ci.yml
releaseInBatch: ${{ parameters.release_springcloudazurestartermonitor }}
TestParallelization: '1'
testAllHttpClients: true
MatrixFilters:

Copilot AI Mar 27, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
MatrixFilters:
matrixFilters:

Copilot uses AI. Check for mistakes.
@rujche

rujche commented Mar 28, 2026

Copy link
Copy Markdown
Member Author

Closing this PR in favor of #48622

@rujche rujche closed this Mar 28, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in Spring Cloud Azure Mar 28, 2026
@rujche rujche moved this from Done to Cut in Spring Cloud Azure Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

azure-spring All azure-spring related issues

Projects

Status: Cut

Development

Successfully merging this pull request may close these issues.

2 participants