Skip to content

YARN-12006. Wait for the first attempt in TestRouterWebServicesREST.getAppAttempt. - #8791

Merged
slfan1989 merged 1 commit into
apache:trunkfrom
joseluisll:YARN-12006
Oct 6, 2026
Merged

slfan1989 merged 1 commit into
apache:trunkfrom
joseluisll:YARN-12006

Conversation

@joseluisll

@joseluisll joseluisll commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Description of PR

JIRA: https://issues.apache.org/jira/browse/YARN-12006

TestRouterWebServicesREST (and TestFederationWebApp, which extends it) fails intermittently in testGetAppAttemptXML and testGetContainersXML with IndexOutOfBoundsException in getAppAttempt. The change is test-only.

  • getAppAttempt read getAttempts().get(0) right after the submission returned, before the RM had created the first attempt. It now waits up to 10s for the attempt and closes the client it creates.
  • testGetAppAttemptXML and testGetContainersXML get a 30s timeout instead of 2s, because they now wait.

Related: YARN-12004 (#8787) fixes the Router-vs-RM comparison races in the same class, which this PR does not address. The two PRs are independent and merge cleanly in either order.

How was this patch tested?

Locally on Linux with OpenJDK 21 and Maven 3.9.11, in hadoop-yarn-server-router, on this PR's head:

  • mvn test -Dtest=TestRouterWebServicesREST,TestFederationWebApp: 94 tests (42 + 52), 0 IndexOutOfBoundsException.
  • testGetAppAttemptXML and testGetContainersXML looped 300 times against one cluster in one JVM (600 runs), : getAppAttempt never failed.

For code changes:

  • Does the title of this PR start with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
  • Object storage: Have the integration tests been executed and the endpoint
    declared according to the connector-specific documentation? Note: Automated CI
    testing doesn't cover all cases so manual testing with cloud storage is still
    required.
    N/A, no object storage changes.
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0? N/A, no new dependencies.
  • If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files? N/A

AI Tooling

If an AI tool was used:

Contains content generated by Claude Code.

…etAppAttempt.

getAppAttempt read getAttempts().get(0) right after the submission
returned, before the RM had created the first attempt, and threw
IndexOutOfBoundsException. Wait up to 10s for the attempt, close the
client, and give the two tests that call it a 30s timeout.

Contains content generated by Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hadoop-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 19m 1s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 45m 12s trunk passed
+1 💚 compile 0m 59s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 compile 0m 59s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 checkstyle 0m 58s trunk passed
+1 💚 mvnsite 1m 1s trunk passed
+1 💚 javadoc 1m 2s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 0m 58s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 spotbugs 1m 25s trunk passed
+1 💚 shadedclient 29m 9s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 28s the patch passed
+1 💚 compile 0m 26s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javac 0m 26s the patch passed
+1 💚 compile 0m 27s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 javac 0m 27s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 22s the patch passed
+1 💚 mvnsite 0m 29s the patch passed
+1 💚 javadoc 0m 26s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 0m 26s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 spotbugs 1m 3s the patch passed
+1 💚 shadedclient 28m 40s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 11m 33s hadoop-yarn-server-router in the patch passed.
+1 💚 asflicense 0m 38s The patch does not generate ASF License warnings.
148m 21s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8791/1/artifact/out/Dockerfile
GITHUB PR #8791
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 590867c4391f 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 853eb71
Default Java Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8791/1/testReport/
Max. process+thread count 1304 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8791/1/console
versions git=2.43.0 maven=3.9.15 spotbugs=4.9.7
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

@slfan1989 slfan1989 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.

Thanks for the fix.

Waiting for the first attempt is appropriate because application submission can return before the RM creates it. The increased test timeouts and client cleanup also look good.

I verified that the previous implementation fails on an empty attempt list, while this change succeeds once an attempt appears and fails after the timeout if the list remains empty.

CI is green.

LGTM, +1.

@slfan1989
slfan1989 merged commit 1b57d32 into apache:trunk Oct 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants