Skip to content

Conversation

pan3793
Copy link
Member

@pan3793 pan3793 commented Aug 19, 2025

Co-authored-by: Justin Brinegar [email protected]
Co-authored-by: Istvan Toth [email protected]

Description of PR

https://docs.oracle.com/en/java/javase/24/security/migrating-deprecated-removal-subject-getsubject-and-subject-doas-methods-subject-current-and-subje.html

In JDK 24, the Security Manager has been permanently disabled. See JEP 486 for more information.

This PR is extracted from @stoty's PR #7434, with some tweaks, which is an alternative to #7081

The main goal is to make minimal changes to make the Hadoop client compatible with Java 25, which unlocks downstream projects that rely on the Hadoop client, e.g. Spark, to support Java 25.

How was this patch tested?

Spark Integration

Integrated with Spark 4.1.0-SNAPSHOT (master branch) with Java 25.

Steps

Install JDK 25-ea and set up JAVA_HOME env

export JAVA_HOME=/path/openjdk-25

Pull this PR, then compile and install Hadoop jars to maven local repo.

git clone -o apache https://github.com/apache/hadoop.git
cd hadoop
git fetch apache pull/7434/head:HADOOP-19212
git checkout HADOOP-19212
mvn clean install -DskipTests

Pull Spark master code, and

git clone -o apache https://github.com/apache/spark.git
cd spark

Modify pom.xml to use the compiled Hadoop Jars

- <hadoop.version>3.4.1</hadoop.version>
+ <hadoop.version>3.5.0-SNAPSHOT</hadoop.version>

Run UT with the compiled Hadoop Jars

build/sbt -Phive,hive-thriftserver,yarn "yarn/test"
build/sbt -Phive,hive-thriftserver,yarn "hive/test"
Before
java.lang.UnsupportedOperationException: getSubject is not supported
    at java.base/javax.security.auth.Subject.getSubject(Subject.java:277)
    at org.apache.hadoop.security.UserGroupInformation.getCurrentUser(UserGroupInformation.java:588)
    at org.apache.hadoop.fs.FileSystem$Cache$Key.<init>(FileSystem.java:3888)
    at org.apache.hadoop.fs.FileSystem$Cache$Key.<init>(FileSystem.java:3878)
    at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:3666)
    at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:557)
    at org.apache.hadoop.fs.FileSystem.getLocal(FileSystem.java:510)
    at org.apache.spark.deploy.yarn.Client$.org$apache$spark$deploy$yarn$Client$$getQualifiedLocalPath(Client.scala:1751)
    at org.apache.spark.deploy.yarn.Client$.addFileToClasspath(Client.scala:1660)
    at org.apache.spark.deploy.yarn.Client$.$anonfun$populateClasspath$3(Client.scala:1549)
    at org.apache.spark.deploy.yarn.Client$.$anonfun$populateClasspath$3$adapted(Client.scala:1548)
    ...
After

With this patch, Spark passes all UTs of the YARN module with Java 25, a few Hive SQL tests fail with irrelevant issues.

Run Spark Job on Kerberized YARN/HDFS cluster

@cxzl25 also helps test this patch using a Spark job on a Kerberized cluster with Java 25, basic SQL, including reading and writing Hive tables, which works as expected.

Hadoop Existing UT

I set up a GitHub Actions workflow in my forked repo to run Hadoop UT with Java 17 and 25.

Note: I have to exclude some UTs because they are flaky or failed consistently even without this PR.

The test jobs show a positive report of this change.
https://github.com/pan3793/hadoop/actions/runs/17120184276

For code changes:

  • Does the title or this PR starts 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?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files?

@stoty
Copy link
Contributor

stoty commented Aug 19, 2025

I think it would be a good idea to initiate a discussion on this implementation on the hadoop-common dev list, or at least ping everyone here who commented on the orignal PRs so that we can get a consensus on this.

Of course this looks good to me.

Also could you add a "co-authored-by" line so that I show up in the github statistics ?

@pan3793
Copy link
Member Author

pan3793 commented Aug 19, 2025

@stoty thanks for your suggestion. I updated the PR description with the "co-authored-by" sections. Since the hadoop-client-minicluster is broken now, I'd like to fix it first before pinging reviewers, so that they can easily to verify this patch.

@cxzl25
Copy link
Contributor

cxzl25 commented Aug 19, 2025

Thanks @pan3793 , I have done some verification in the production cluster to confirm that this PR works.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 32s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s 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 doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+0 🆗 mvndep 8m 49s Maven dependency ordering for branch
+1 💚 mvninstall 33m 7s trunk passed
+1 💚 compile 15m 52s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 compile 13m 50s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 checkstyle 1m 23s trunk passed
+1 💚 mvnsite 2m 26s trunk passed
+1 💚 javadoc 2m 4s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 1m 39s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 spotbugs 3m 33s trunk passed
+1 💚 shadedclient 37m 26s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 33s Maven dependency ordering for patch
+1 💚 mvninstall 1m 17s the patch passed
+1 💚 compile 15m 8s the patch passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javac 15m 8s the patch passed
+1 💚 compile 14m 18s the patch passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 javac 14m 18s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 1m 23s /results-checkstyle-hadoop-common-project.txt hadoop-common-project: The patch generated 4 new + 73 unchanged - 0 fixed = 77 total (was 73)
+1 💚 mvnsite 2m 22s the patch passed
-1 ❌ javadoc 0m 38s /results-javadoc-javadoc-hadoop-common-project_hadoop-auth-jdkUbuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04.txt hadoop-common-project_hadoop-auth-jdkUbuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04 with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04 generated 4 new + 0 unchanged - 0 fixed = 4 total (was 0)
-1 ❌ javadoc 0m 36s /results-javadoc-javadoc-hadoop-common-project_hadoop-auth-jdkPrivateBuild-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09.txt hadoop-common-project_hadoop-auth-jdkPrivateBuild-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09 with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09 generated 4 new + 0 unchanged - 0 fixed = 4 total (was 0)
+1 💚 spotbugs 3m 59s the patch passed
+1 💚 shadedclient 38m 31s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 3m 42s hadoop-auth in the patch passed.
+1 💚 unit 22m 48s hadoop-common in the patch passed.
+1 💚 asflicense 1m 6s The patch does not generate ASF License warnings.
230m 19s
Subsystem Report/Notes
Docker ClientAPI=1.51 ServerAPI=1.51 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/1/artifact/out/Dockerfile
GITHUB PR #7886
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 6c1cacd17c9d 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 0b077ad
Default Java Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/1/testReport/
Max. process+thread count 2508 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-auth hadoop-common-project/hadoop-common U: hadoop-common-project
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/1/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@pan3793
Copy link
Member Author

pan3793 commented Aug 19, 2025

Spotted an issue during self-review, the thrown exception seems to have an additional wrapper on JDK 25, related test cases

Error:  Failures: 
Error:    TestClientRMTokens.testShortCircuitRenewCancelDifferentHostDifferentPort:355->checkShortCircuitRenewCancel:431 expected: <getProxy> but was: <java.lang.RuntimeException: getProxy>
Error:    TestClientRMTokens.testShortCircuitRenewCancelDifferentHostSamePort:344->checkShortCircuitRenewCancel:431 expected: <getProxy> but was: <java.lang.RuntimeException: getProxy>
Error:    TestClientRMTokens.testShortCircuitRenewCancelSameHostDifferentPort:333->checkShortCircuitRenewCancel:431 expected: <getProxy> but was: <java.lang.RuntimeException: getProxy>

Updated:
Fixed via 69a2ccf

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 46s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+0 🆗 mvndep 8m 46s Maven dependency ordering for branch
+1 💚 mvninstall 38m 26s trunk passed
+1 💚 compile 18m 11s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 compile 15m 38s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 checkstyle 1m 26s trunk passed
+1 💚 mvnsite 2m 18s trunk passed
+1 💚 javadoc 2m 1s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 1m 34s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 spotbugs 3m 28s trunk passed
+1 💚 shadedclient 44m 43s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 34s Maven dependency ordering for patch
+1 💚 mvninstall 1m 19s the patch passed
+1 💚 compile 17m 6s the patch passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javac 17m 6s the patch passed
+1 💚 compile 15m 50s the patch passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 javac 15m 50s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 1m 24s /results-checkstyle-hadoop-common-project.txt hadoop-common-project: The patch generated 4 new + 73 unchanged - 0 fixed = 77 total (was 73)
+1 💚 mvnsite 2m 16s the patch passed
-1 ❌ javadoc 0m 43s /results-javadoc-javadoc-hadoop-common-project_hadoop-auth-jdkUbuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04.txt hadoop-common-project_hadoop-auth-jdkUbuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04 with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04 generated 4 new + 0 unchanged - 0 fixed = 4 total (was 0)
-1 ❌ javadoc 0m 40s /results-javadoc-javadoc-hadoop-common-project_hadoop-auth-jdkPrivateBuild-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09.txt hadoop-common-project_hadoop-auth-jdkPrivateBuild-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09 with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09 generated 4 new + 0 unchanged - 0 fixed = 4 total (was 0)
+1 💚 spotbugs 3m 49s the patch passed
+1 💚 shadedclient 43m 24s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 3m 44s hadoop-auth in the patch passed.
+1 💚 unit 22m 39s hadoop-common in the patch passed.
+1 💚 asflicense 1m 5s The patch does not generate ASF License warnings.
255m 45s
Subsystem Report/Notes
Docker ClientAPI=1.51 ServerAPI=1.51 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/2/artifact/out/Dockerfile
GITHUB PR #7886
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 512b641ece1f 5.15.0-144-generic #157-Ubuntu SMP Mon Jun 16 07:33:10 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / e5d544b
Default Java Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/2/testReport/
Max. process+thread count 1249 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-auth hadoop-common-project/hadoop-common U: hadoop-common-project
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/2/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@slfan1989 slfan1989 requested a review from Copilot August 19, 2025 23:48
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates Hadoop's UserGroupInformation (UGI) to be compatible with Java 25 by replacing deprecated Subject methods with a new compatibility utility. The deprecated Subject.getSubject(AccessControlContext) and Subject.doAs() methods have been removed in Java 24+, requiring a migration to Subject.current() and Subject.callAs().

  • Introduces a new SubjectUtil class that provides compatibility between old and new Subject APIs
  • Updates UGI to use the compatibility utility instead of deprecated methods
  • Updates KerberosAuthenticator to use the new utility for getting current subject

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
UserGroupInformation.java Updated to use SubjectUtil for getting current subject and executing privileged actions
SubjectUtil.java New utility class providing compatibility between deprecated and new Subject APIs
KerberosAuthenticator.java Updated to use SubjectUtil for getting current subject

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@pan3793
Copy link
Member Author

pan3793 commented Aug 20, 2025

This PR is ready for review.

cc @steveloughran @stoty @cnauroth @slfan1989 @jbrinegar

Also cc @dongjoon-hyun @LuciferYang from the Spark community, this unblocks Spark to support JDK 25

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 19s 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 doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+0 🆗 mvndep 8m 38s Maven dependency ordering for branch
+1 💚 mvninstall 19m 44s trunk passed
+1 💚 compile 8m 25s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 compile 7m 30s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 checkstyle 0m 44s trunk passed
+1 💚 mvnsite 1m 30s trunk passed
+1 💚 javadoc 1m 15s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 1m 0s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 spotbugs 2m 6s trunk passed
+1 💚 shadedclient 22m 14s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 21s Maven dependency ordering for patch
+1 💚 mvninstall 0m 45s the patch passed
+1 💚 compile 8m 5s the patch passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javac 8m 5s the patch passed
+1 💚 compile 7m 33s the patch passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 javac 7m 33s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 0m 44s /results-checkstyle-hadoop-common-project.txt hadoop-common-project: The patch generated 5 new + 73 unchanged - 0 fixed = 78 total (was 73)
+1 💚 mvnsite 1m 31s the patch passed
-1 ❌ javadoc 0m 29s /results-javadoc-javadoc-hadoop-common-project_hadoop-auth-jdkUbuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04.txt hadoop-common-project_hadoop-auth-jdkUbuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04 with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04 generated 4 new + 0 unchanged - 0 fixed = 4 total (was 0)
-1 ❌ javadoc 0m 29s /results-javadoc-javadoc-hadoop-common-project_hadoop-auth-jdkPrivateBuild-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09.txt hadoop-common-project_hadoop-auth-jdkPrivateBuild-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09 with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09 generated 4 new + 0 unchanged - 0 fixed = 4 total (was 0)
+1 💚 spotbugs 2m 22s the patch passed
+1 💚 shadedclient 22m 10s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 3m 8s hadoop-auth in the patch passed.
+1 💚 unit 18m 23s hadoop-common in the patch passed.
+1 💚 asflicense 0m 40s The patch does not generate ASF License warnings.
142m 52s
Subsystem Report/Notes
Docker ClientAPI=1.51 ServerAPI=1.51 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/3/artifact/out/Dockerfile
GITHUB PR #7886
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 6347885a56c9 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 69a2ccf
Default Java Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/3/testReport/
Max. process+thread count 3152 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-auth hadoop-common-project/hadoop-common U: hadoop-common-project
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/3/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 35s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+0 🆗 mvndep 9m 9s Maven dependency ordering for branch
+1 💚 mvninstall 32m 19s trunk passed
+1 💚 compile 15m 45s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 compile 13m 38s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 checkstyle 1m 24s trunk passed
+1 💚 mvnsite 2m 30s trunk passed
+1 💚 javadoc 2m 5s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 1m 39s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 spotbugs 3m 31s trunk passed
+1 💚 shadedclient 37m 59s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 33s Maven dependency ordering for patch
+1 💚 mvninstall 1m 18s the patch passed
+1 💚 compile 14m 59s the patch passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javac 14m 59s the patch passed
+1 💚 compile 13m 30s the patch passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 javac 13m 30s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 1m 20s /results-checkstyle-hadoop-common-project.txt hadoop-common-project: The patch generated 4 new + 73 unchanged - 0 fixed = 77 total (was 73)
+1 💚 mvnsite 2m 27s the patch passed
-1 ❌ javadoc 0m 45s /results-javadoc-javadoc-hadoop-common-project_hadoop-auth-jdkUbuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04.txt hadoop-common-project_hadoop-auth-jdkUbuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04 with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04 generated 4 new + 0 unchanged - 0 fixed = 4 total (was 0)
-1 ❌ javadoc 0m 43s /results-javadoc-javadoc-hadoop-common-project_hadoop-auth-jdkPrivateBuild-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09.txt hadoop-common-project_hadoop-auth-jdkPrivateBuild-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09 with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09 generated 4 new + 0 unchanged - 0 fixed = 4 total (was 0)
+1 💚 spotbugs 3m 52s the patch passed
+1 💚 shadedclient 38m 57s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 3m 44s hadoop-auth in the patch passed.
+1 💚 unit 22m 42s hadoop-common in the patch passed.
+1 💚 asflicense 1m 7s The patch does not generate ASF License warnings.
230m 19s
Subsystem Report/Notes
Docker ClientAPI=1.51 ServerAPI=1.51 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/4/artifact/out/Dockerfile
GITHUB PR #7886
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 36424f2be61f 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 9ea6317
Default Java Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/4/testReport/
Max. process+thread count 3152 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-auth hadoop-common-project/hadoop-common U: hadoop-common-project
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/4/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 20s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s 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 doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+0 🆗 mvndep 8m 29s Maven dependency ordering for branch
+1 💚 mvninstall 19m 51s trunk passed
+1 💚 compile 8m 26s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 compile 7m 26s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 checkstyle 0m 47s trunk passed
+1 💚 mvnsite 1m 30s trunk passed
+1 💚 javadoc 1m 17s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 1m 1s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 spotbugs 2m 5s trunk passed
+1 💚 shadedclient 22m 32s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 22s Maven dependency ordering for patch
+1 💚 mvninstall 0m 47s the patch passed
+1 💚 compile 7m 54s the patch passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javac 7m 54s the patch passed
+1 💚 compile 7m 25s the patch passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 javac 7m 25s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 0m 42s /results-checkstyle-hadoop-common-project.txt hadoop-common-project: The patch generated 5 new + 73 unchanged - 0 fixed = 78 total (was 73)
+1 💚 mvnsite 1m 27s the patch passed
+1 💚 javadoc 1m 12s the patch passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 1m 3s the patch passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 spotbugs 2m 17s the patch passed
+1 💚 shadedclient 22m 25s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 3m 9s hadoop-auth in the patch passed.
+1 💚 unit 18m 21s hadoop-common in the patch passed.
+1 💚 asflicense 0m 41s The patch does not generate ASF License warnings.
143m 5s
Subsystem Report/Notes
Docker ClientAPI=1.51 ServerAPI=1.51 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/6/artifact/out/Dockerfile
GITHUB PR #7886
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 0e8c0b671fe2 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 5d407b3
Default Java Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/6/testReport/
Max. process+thread count 3153 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-auth hadoop-common-project/hadoop-common U: hadoop-common-project
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/6/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 48s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+0 🆗 mvndep 8m 27s Maven dependency ordering for branch
+1 💚 mvninstall 37m 42s trunk passed
+1 💚 compile 17m 49s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 compile 15m 11s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 checkstyle 1m 26s trunk passed
+1 💚 mvnsite 2m 24s trunk passed
+1 💚 javadoc 1m 57s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 1m 23s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 spotbugs 3m 30s trunk passed
+1 💚 shadedclient 42m 52s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 32s Maven dependency ordering for patch
+1 💚 mvninstall 1m 15s the patch passed
+1 💚 compile 16m 49s the patch passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javac 16m 49s the patch passed
+1 💚 compile 15m 10s the patch passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 javac 15m 10s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 1m 22s /results-checkstyle-hadoop-common-project.txt hadoop-common-project: The patch generated 4 new + 73 unchanged - 0 fixed = 77 total (was 73)
+1 💚 mvnsite 2m 21s the patch passed
+1 💚 javadoc 1m 57s the patch passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 1m 26s the patch passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 spotbugs 3m 48s the patch passed
+1 💚 shadedclient 44m 37s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 3m 43s hadoop-auth in the patch passed.
+1 💚 unit 22m 33s hadoop-common in the patch passed.
+1 💚 asflicense 1m 5s The patch does not generate ASF License warnings.
251m 49s
Subsystem Report/Notes
Docker ClientAPI=1.51 ServerAPI=1.51 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/5/artifact/out/Dockerfile
GITHUB PR #7886
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 16801a02db0d 5.15.0-144-generic #157-Ubuntu SMP Mon Jun 16 07:33:10 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / a2f7525
Default Java Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/5/testReport/
Max. process+thread count 2136 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-auth hadoop-common-project/hadoop-common U: hadoop-common-project
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/5/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@steveloughran
Copy link
Contributor

trivial checkstyles need fixing

./hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/util/SubjectUtil.java:35:@Private:1: Utility classes should not have a public or default constructor. [HideUtilityClassConstructor]
./hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/util/SubjectUtil.java:37:  private static MethodHandle CALL_AS;:31: Name 'CALL_AS' must match pattern '^[a-z][a-zA-Z0-9]*$'. [StaticVariableName]
./hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/util/SubjectUtil.java:38:  private static MethodHandle CURRENT;:31: Name 'CURRENT' must match pattern '^[a-z][a-zA-Z0-9]*$'. [StaticVariableName]
./hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/util/SubjectUtil.java:196:  /**: First sentence should end with a period. [JavadocStyle]

@pan3793
Copy link
Member Author

pan3793 commented Aug 20, 2025

@steveloughran just fixed 1 and 4, but 2 and 3 look weird, why the static var name should start with a lower-case letter?

./hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/util/SubjectUtil.java:37:  private static MethodHandle CALL_AS;:31: Name 'CALL_AS' must match pattern '^[a-z][a-zA-Z0-9]*$'. [StaticVariableName]
./hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/util/SubjectUtil.java:38:  private static MethodHandle CURRENT;:31: Name 'CURRENT' must match pattern '^[a-z][a-zA-Z0-9]*$'. [StaticVariableName]

Copy link
Contributor

@steveloughran steveloughran left a comment

Choose a reason for hiding this comment

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

reviewed. As well as javadocs I'd like some unit tests on exception handling.


@Private
public class SubjectUtil {
private static MethodHandle CALL_AS;
Copy link
Contributor

Choose a reason for hiding this comment

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

thes should be final, as the static sections are trying to set them up as such. This may need some tuning of that code so that the compiler is happy there's only one attempt ever made to set it.

}

@SuppressWarnings("unchecked")
private static <E extends Throwable> RuntimeException sneakyThrow(Throwable e) throws E {
Copy link
Contributor

Choose a reason for hiding this comment

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

add javadoc -it is a use of templates I've not seen before...having the type of raised exception inferred from the context around the invocation

Copy link
Member Author

Choose a reason for hiding this comment

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

this article explains how it works
https://www.baeldung.com/java-sneaky-throws

* thrown by {@code action.call()}.
*/
@SuppressWarnings("unchecked")
public static <T> T callAs(Subject subject, Callable<T> action) throws CompletionException {
Copy link
Contributor

Choose a reason for hiding this comment

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

add test, verify that

  • callable throwing a PrivilegedActionException is mapped to completion exception
  • callable raising any RTE is handled correctly

* @return the result of the action
* @param <T> the type of the result
*/
public static <T> T doAs(Subject subject, PrivilegedAction<T> action) {
Copy link
Contributor

Choose a reason for hiding this comment

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

tests to verify handling. what happens if the callable raises a CompletionException without an inner cause? that "should never happen" path is reached -so verify

Copy link
Member Author

Choose a reason for hiding this comment

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

I see, it's possible in the legacy doAs case

Copy link
Member Author

Choose a reason for hiding this comment

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

during constructing the test cases, I realized the current approach seems impossible to keep original exception propagation behavior ...

for example, in JDK 17, SubjectUtil.callAs binds to Subject.doAs, it's unable to distinguish 1) action throws a PrivilegedActionException, from 2) the bound doAs wrap the original exception thrown by action with a PrivilegedActionException

@stoty I think I need to go back to #7081 direction ...

Copy link
Member Author

Choose a reason for hiding this comment

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

the exception propagation mechanism is changed in Java 12 ... I refactored the code, and added TestSubjectUtil to cover all cases I can imagine.

Now, the UT passed under JDK 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25

mvn -Dsurefire.failIfNoSpecifiedTests=false install -pl :hadoop-auth -am -Dtest=TestSubjectUtil

Copy link
Contributor

Choose a reason for hiding this comment

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

https://github.com/openjdk/jdk21/blob/890adb6410dab4606a4f26a942aed02fb2f55387/src/java.base/share/classes/javax/security/auth/Subject.java#L375

https://github.com/openjdk/jdk24u/blob/b42f146edb8324bbb164bb706e8ad39d60aaf25b/src/java.base/share/classes/javax/security/auth/Subject.java#L327

So doAs() throws NPE and Security exceptions directly, and wraps Exceptions from the Action in a PrivilegedExceptionAction , while
callAs() wraps every Exception in a CompletionException.

So yes, we do lose some information when using callAs(), as we can't (easily) distinguish between NPEs and SecurityExceptions thrown in doAs itself or in the callable.

However, UGI.doAs() unwraps PrivilegedActionExceptions anyway (and adds the IOException constraint) so I can't really see any case when this would actually matter.

So by shortcutting doAs() for older JDKs the only difference is that we're throwing NPEs and SecurityExceptions from the doAs() method itself directly, while in the wrapped case we're wrapping them in an UndeclaredThrowableException, and even this is only matters in JDK 17, and JDK18+ wraps all exceptions in a CompletionException anyway (just like SubjectUtil does)

I support adding the shortcut, but more as optimization than a correctness fix.

Copy link
Member Author

@pan3793 pan3793 Aug 21, 2025

Choose a reason for hiding this comment

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

I see, I added Objects.requireNonNull(action) at the begin of each method

if (cause != null) {
throw sneakyThrow(cause);
} else {
// This should never happen, as CompletionException should always wrap an exception
Copy link
Contributor

Choose a reason for hiding this comment

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

unless the invoked callable raises it

import org.apache.hadoop.classification.InterfaceAudience.Private;

@Private
public class SubjectUtil {
Copy link
Contributor

Choose a reason for hiding this comment

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

add javadocs.

I think there should also be some boolean indicating whether the new or old methods were picked up. This can be accompanied by a unit test which verifies that on java > 17 the new ones are found.

@pan3793
Copy link
Member Author

pan3793 commented Aug 20, 2025

@steveloughran thanks for your feedback, will address ASAP. BTW, I see that Hadoop 3.4.2 RC2 failed, if this PR gets merged before 3.4.2 is released, would you mind including it in 3.4.2? (I don't mean block the release, just nice to have)

SubjectUtil.class, "callableToPrivilegedExceptionAction", convertSignature);
CALL_AS = MethodHandles.filterArguments(doAs, 1, converter);
} catch (NoSuchMethodException e) {
throw new AssertionError(e);

Choose a reason for hiding this comment

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

I suggest throwing ExceptionInInitializerError rather than AssertionError in the static block.

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks for suggestion, adopted


@SuppressWarnings("unchecked")
private static <E extends Throwable> RuntimeException sneakyThrow(Throwable e) throws E {
throw (E) e;

Choose a reason for hiding this comment

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

Type checking should be performed here. For RuntimeException and Error, they should be thrown directly, while other exceptions should be wrapped into a RuntimeException and then thrown.

Additionally, does this method need to specify a return value type?

Copy link
Member Author

Choose a reason for hiding this comment

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

the intention here is to allow the caller method to throw the checked exception without explicitly exception list declaration
https://www.baeldung.com/java-sneaky-throws

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 35s 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 _
+0 🆗 mvndep 9m 43s Maven dependency ordering for branch
+1 💚 mvninstall 32m 28s trunk passed
+1 💚 compile 15m 44s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 compile 13m 35s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 checkstyle 1m 24s trunk passed
+1 💚 mvnsite 2m 27s trunk passed
+1 💚 javadoc 2m 5s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 1m 39s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 spotbugs 3m 34s trunk passed
+1 💚 shadedclient 37m 11s branch has no errors when building and testing our client artifacts.
-0 ⚠️ patch 37m 38s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 34s Maven dependency ordering for patch
+1 💚 mvninstall 1m 18s the patch passed
+1 💚 compile 15m 8s the patch passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javac 15m 8s the patch passed
+1 💚 compile 13m 47s the patch passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 javac 13m 47s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 1m 22s the patch passed
+1 💚 mvnsite 2m 26s the patch passed
+1 💚 javadoc 1m 55s the patch passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 1m 40s the patch passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 spotbugs 3m 51s the patch passed
+1 💚 shadedclient 37m 42s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 3m 46s hadoop-auth in the patch passed.
+1 💚 unit 22m 53s hadoop-common in the patch passed.
+1 💚 asflicense 1m 6s The patch does not generate ASF License warnings.
229m 21s
Subsystem Report/Notes
Docker ClientAPI=1.51 ServerAPI=1.51 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/10/artifact/out/Dockerfile
GITHUB PR #7886
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux b918c5d43cd9 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 824800f
Default Java Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/10/testReport/
Max. process+thread count 2161 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-auth hadoop-common-project/hadoop-common U: hadoop-common-project
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/10/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 49s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s 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 _
+0 🆗 mvndep 8m 57s Maven dependency ordering for branch
+1 💚 mvninstall 37m 44s trunk passed
+1 💚 compile 18m 0s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 compile 15m 12s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 checkstyle 1m 25s trunk passed
+1 💚 mvnsite 2m 17s trunk passed
+1 💚 javadoc 2m 0s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 1m 33s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 spotbugs 3m 32s trunk passed
+1 💚 shadedclient 42m 30s branch has no errors when building and testing our client artifacts.
-0 ⚠️ patch 42m 58s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 33s Maven dependency ordering for patch
+1 💚 mvninstall 1m 17s the patch passed
+1 💚 compile 17m 17s the patch passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javac 17m 17s the patch passed
+1 💚 compile 15m 16s the patch passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 javac 15m 16s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 1m 20s the patch passed
+1 💚 mvnsite 2m 20s the patch passed
+1 💚 javadoc 1m 48s the patch passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 1m 27s the patch passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 spotbugs 3m 47s the patch passed
+1 💚 shadedclient 43m 14s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 3m 44s hadoop-auth in the patch passed.
+1 💚 unit 22m 35s hadoop-common in the patch passed.
+1 💚 asflicense 1m 5s The patch does not generate ASF License warnings.
251m 4s
Subsystem Report/Notes
Docker ClientAPI=1.51 ServerAPI=1.51 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/11/artifact/out/Dockerfile
GITHUB PR #7886
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux b41fa05aeec4 5.15.0-144-generic #157-Ubuntu SMP Mon Jun 16 07:33:10 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / e92529b
Default Java Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/11/testReport/
Max. process+thread count 3135 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-auth hadoop-common-project/hadoop-common U: hadoop-common-project
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/11/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 36s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s 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 _
+0 🆗 mvndep 9m 1s Maven dependency ordering for branch
+1 💚 mvninstall 36m 6s trunk passed
+1 💚 compile 17m 4s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 compile 14m 52s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 checkstyle 1m 24s trunk passed
+1 💚 mvnsite 2m 31s trunk passed
+1 💚 javadoc 2m 3s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 1m 33s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 spotbugs 3m 35s trunk passed
+1 💚 shadedclient 39m 19s branch has no errors when building and testing our client artifacts.
-0 ⚠️ patch 39m 45s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 33s Maven dependency ordering for patch
+1 💚 mvninstall 1m 18s the patch passed
+1 💚 compile 15m 4s the patch passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javac 15m 4s the patch passed
+1 💚 compile 13m 36s the patch passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 javac 13m 36s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 1m 19s the patch passed
+1 💚 mvnsite 2m 25s the patch passed
+1 💚 javadoc 1m 58s the patch passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 1m 38s the patch passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 spotbugs 3m 50s the patch passed
+1 💚 shadedclient 37m 21s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 3m 43s hadoop-auth in the patch passed.
+1 💚 unit 22m 52s hadoop-common in the patch passed.
+1 💚 asflicense 1m 7s The patch does not generate ASF License warnings.
236m 28s
Subsystem Report/Notes
Docker ClientAPI=1.51 ServerAPI=1.51 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/12/artifact/out/Dockerfile
GITHUB PR #7886
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 6f28875c50ff 5.15.0-144-generic #157-Ubuntu SMP Mon Jun 16 07:33:10 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 9512cb2
Default Java Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/12/testReport/
Max. process+thread count 3152 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-auth hadoop-common-project/hadoop-common U: hadoop-common-project
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/12/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@slfan1989
Copy link
Contributor

@pan3793 Thank you for your contribution! From my perspective, I would give this a +0.5, mainly because I’m not very familiar with this part. However, I hope this PR can receive consensus and full approval from the other reviewers.

cc: @stoty @steveloughran @cnauroth @cxzl25 @LuciferYang @dongjoon-hyun

@slfan1989
Copy link
Contributor

@stoty Do you have any further suggestions? If we confirm that this PR is fine, we will proceed to merge it.
cc: @pan3793

@slfan1989
Copy link
Contributor

@ahmarsuhail Pan asked me offline whether this feature could be released in 3.4.2. Do you think that’s possible? I see that the vote for 3.4.2 is still ongoing — can we include this PR in RC3?

cc: @pan3793 @steveloughran

@LuciferYang
Copy link

It would be very delightful if this pr could be included in 3.4.2.

@stoty
Copy link
Contributor

stoty commented Aug 25, 2025

@stoty Do you have any further suggestions? If we confirm that this PR is fine, we will proceed to merge it. cc: @pan3793

This is derived from the same code that Jetty has, save the shortcut fallback for JDK17.
I think that this is fine.

Copy link
Contributor

@stoty stoty left a comment

Choose a reason for hiding this comment

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

+1 LGTM

nit: May want to add notes about the linegae of this implementation.

@slfan1989
Copy link
Contributor

+1 LGTM

nit: May want to add notes about the linegae of this implementation.

@stoty Thank you very much for reviewing the code!

Copy link
Contributor

@cxzl25 cxzl25 left a comment

Choose a reason for hiding this comment

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

Based on the latest code, I was testing in JDK25+Spark3+YARN+Kerberos that some SQL can run normally.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 8m 35s 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 _
+0 🆗 mvndep 7m 57s Maven dependency ordering for branch
+1 💚 mvninstall 19m 37s trunk passed
+1 💚 compile 8m 25s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 compile 7m 28s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 checkstyle 0m 46s trunk passed
+1 💚 mvnsite 1m 29s trunk passed
+1 💚 javadoc 1m 18s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 1m 3s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 spotbugs 2m 7s trunk passed
+1 💚 shadedclient 22m 27s branch has no errors when building and testing our client artifacts.
-0 ⚠️ patch 22m 42s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 24s Maven dependency ordering for patch
+1 💚 mvninstall 0m 46s the patch passed
+1 💚 compile 8m 6s the patch passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javac 8m 6s the patch passed
+1 💚 compile 7m 31s the patch passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 javac 7m 31s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 40s the patch passed
+1 💚 mvnsite 1m 26s the patch passed
+1 💚 javadoc 1m 13s the patch passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 1m 4s the patch passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 spotbugs 2m 17s the patch passed
+1 💚 shadedclient 22m 29s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 3m 6s hadoop-auth in the patch passed.
+1 💚 unit 18m 26s hadoop-common in the patch passed.
+1 💚 asflicense 0m 41s The patch does not generate ASF License warnings.
150m 43s
Subsystem Report/Notes
Docker ClientAPI=1.51 ServerAPI=1.51 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/13/artifact/out/Dockerfile
GITHUB PR #7886
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 8093bb24782a 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 917baf0
Default Java Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/13/testReport/
Max. process+thread count 3153 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-auth hadoop-common-project/hadoop-common U: hadoop-common-project
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7886/13/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@slfan1989
Copy link
Contributor

@stoty @cxzl25 @LuciferYang Thank you all for your help and support! @pan3793 Thanks for the contribution!

I will add @steveloughran @stoty @cxzl25 @LuciferYang to the review list. I will add @stoty as a co-author.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM. Thank you all!

Copy link
Contributor

@cnauroth cnauroth left a comment

Choose a reason for hiding this comment

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

+1. Thank you, @stoty and @pan3793 !

@slfan1989 slfan1989 merged commit b440e55 into apache:trunk Aug 26, 2025
4 checks passed
@slfan1989
Copy link
Contributor

@pan3793 @stoty Thanks for the contribution! @steveloughran @cxzl25 @LuciferYang @cnauroth Thanks for the review!

pan3793 added a commit to pan3793/hadoop that referenced this pull request Aug 26, 2025
* Hadoop UGI compatible with Java 25

Co-authored-by: Istvan Toth <[email protected]>
Reviewed-by: Shaoyun Chen <[email protected]>
Reviewed-by: Dongjoon Hyun <[email protected]>
Reviewed-by: Yang Jie <[email protected]>
Reviewed-by: Steve Loughran <[email protected]>
Reviewed-by: Chris Nauroth <[email protected]>
Reviewed-by: Istvan Toth <[email protected]>
Signed-off-by: Shilun Fan <[email protected]>
@ahmarsuhail
Copy link
Contributor

@slfan1989 @pan3793 Voting for RC3 is currently on-going, started last last thursday. We have 5 binding votes already so I think we should be able to successfully release 3.4.2 soon. If for any reason that doesn't happen, we can get this into 3.4.2

@pan3793
Copy link
Member Author

pan3793 commented Aug 26, 2025

@ahmarsuhail thank you for the information

slfan1989 pushed a commit that referenced this pull request Aug 27, 2025
* HADOOP-19212. Hadoop UGI compatible with Java 25.

Co-authored-by: Istvan Toth <[email protected]>
Signed-off-by: Shilun Fan <[email protected]>
@slfan1989
Copy link
Contributor

@slfan1989 @pan3793 Voting for RC3 is currently on-going, started last last thursday. We have 5 binding votes already so I think we should be able to successfully release 3.4.2 soon. If for any reason that doesn't happen, we can get this into 3.4.2

@ahmarsuhail Sorry for the late reply. I’ve discussed with @pan3793 offline, and we plan to release this PR in the next version, as additional PRs may be needed to ensure greater stability. Thank you all for your contributions to the 3.4.2 release!

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.

10 participants