Skip to content
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

HADOOP-19212. Avoid Subject.getSubject method on newer JVMs #7081

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

jbrinegar
Copy link

In Java 23, Subject.getSubject requires setting the system property java.security.manager to allow, else it will throw an exception. More detail is available in the release notes: https://jdk.java.net/23/release-notes

This is in support of the eventual removal of the security manager, at which point, Subject.getSubject will be removed. Since this project supports older Java releases, and the API which one must migrate to was only introduced in Java 18, I hid the implementations behind a runtime version check. I verified against several local Java versions that the correct classes are loaded (and more importantly, that the incorrect classes are not loaded). The outright removal of the security manager, and by extension the Subject.getSubject method would be a particularly large problem if we do not address this, which was my motivation here.

Some manual testing on Java 11, 17, and 23:

» java --version
openjdk 11.0.23 2024-04-16 LTS
» java -cp hadoop-auth-3.5.0-SNAPSHOT.jar org.apache.hadoop.util.subject.SubjectAdapter
Current subject is null

» java --version
openjdk 17.0.5 2022-10-18 LTS
» java -cp hadoop-auth-3.5.0-SNAPSHOT.jar org.apache.hadoop.util.subject.SubjectAdapter
Current subject is null

» java --version
openjdk 23 2024-09-17
» java -cp hadoop-auth-3.5.0-SNAPSHOT.jar org.apache.hadoop.util.subject.SubjectAdapter
Current subject is null

As desired, the class containing the old implementation does not get loaded on a new JVM:

» java --version
openjdk 23 2024-09-17
» java -verbose:class -cp hadoop-auth-3.5.0-SNAPSHOT.jar org.apache.hadoop.util.subject.SubjectAdapter | \grep -i subject | grep "class,load" | awk '{print $2}'
org.apache.hadoop.util.subject.SubjectAdapter
org.apache.hadoop.util.subject.HiddenGetSubject
javax.security.auth.Subject
org.apache.hadoop.util.subject.GetSubjectNg

And the inverse is true for an older JVM:

» java --version
openjdk 17.0.5 2022-10-18 LTS
» java -verbose:class -cp hadoop-auth-3.5.0-SNAPSHOT.jar org.apache.hadoop.util.subject.SubjectAdapter | \grep -i subject | grep "class,load" | awk '{print $2}'
org.apache.hadoop.util.subject.SubjectAdapter
org.apache.hadoop.util.subject.HiddenGetSubject
javax.security.auth.Subject
org.apache.hadoop.util.subject.ClassicGetSubject
javax.security.auth.Subject$1

Description of PR

How was this patch tested?

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?

In Java 23, Subject.getSubject requires setting the system property java.security.manager to allow, else it will throw an exception.  More detail is available in the release notes: https://jdk.java.net/23/release-notes

This is in support of the eventual removal of the security manager, at which point, Subject.getSubject will be removed.  Since this project supports older Java releases, and the API which one must migrate to was only introduced in Java 18, I hid the implementations behind a runtime version check.  I verified against several local Java versions that the correct classes are loaded (and more importantly, that the incorrect classes are _not_ loaded).  The outright removal of the security manager, and by extension the Subject.getSubject method would be a particularly large problem if we do not address this, which was my motivation here.

Some manual testing on Java 11, 17, and 23:

```
» java --version
openjdk 11.0.23 2024-04-16 LTS
» java -cp hadoop-auth-3.5.0-SNAPSHOT.jar org.apache.hadoop.util.subject.SubjectAdapter
Current subject is null

» java --version
openjdk 17.0.5 2022-10-18 LTS
» java -cp hadoop-auth-3.5.0-SNAPSHOT.jar org.apache.hadoop.util.subject.SubjectAdapter
Current subject is null

» java --version
openjdk 23 2024-09-17
» java -cp hadoop-auth-3.5.0-SNAPSHOT.jar org.apache.hadoop.util.subject.SubjectAdapter
Current subject is null
```

As desired, the class containing the old implementation does not get loaded on a new JVM:
```
» java --version
openjdk 23 2024-09-17
» java -verbose:class -cp hadoop-auth-3.5.0-SNAPSHOT.jar org.apache.hadoop.util.subject.SubjectAdapter | \grep -i subject | grep "class,load" | awk '{print $2}'
org.apache.hadoop.util.subject.SubjectAdapter
org.apache.hadoop.util.subject.HiddenGetSubject
javax.security.auth.Subject
org.apache.hadoop.util.subject.GetSubjectNg
```

And the inverse is true for an older JVM:
```
» java --version
openjdk 17.0.5 2022-10-18 LTS
» java -verbose:class -cp hadoop-auth-3.5.0-SNAPSHOT.jar org.apache.hadoop.util.subject.SubjectAdapter | \grep -i subject | grep "class,load" | awk '{print $2}'
org.apache.hadoop.util.subject.SubjectAdapter
org.apache.hadoop.util.subject.HiddenGetSubject
javax.security.auth.Subject
org.apache.hadoop.util.subject.ClassicGetSubject
javax.security.auth.Subject$1
```
@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 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 14m 56s Maven dependency ordering for branch
+1 💚 mvninstall 37m 42s trunk passed
+1 💚 compile 19m 49s trunk passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 compile 18m 16s trunk passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 checkstyle 1m 28s trunk passed
+1 💚 mvnsite 2m 27s trunk passed
+1 💚 javadoc 2m 3s trunk passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javadoc 1m 34s trunk passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 spotbugs 3m 31s trunk passed
+1 💚 shadedclient 41m 40s 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 19s the patch passed
+1 💚 compile 18m 46s the patch passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javac 18m 46s the patch passed
+1 💚 compile 18m 16s the patch passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 javac 18m 16s 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 50 new + 73 unchanged - 0 fixed = 123 total (was 73)
+1 💚 mvnsite 2m 28s the patch passed
+1 💚 javadoc 1m 55s the patch passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javadoc 1m 33s the patch passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 spotbugs 3m 52s the patch passed
+1 💚 shadedclient 42m 46s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 3m 27s hadoop-auth in the patch passed.
+1 💚 unit 19m 35s hadoop-common in the patch passed.
+1 💚 asflicense 1m 4s The patch does not generate ASF License warnings.
262m 23s
Subsystem Report/Notes
Docker ClientAPI=1.47 ServerAPI=1.47 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7081/1/artifact/out/Dockerfile
GITHUB PR #7081
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 18e6ff302126 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 9541294
Default Java Private Build-1.8.0_422-8u422-b05-1~20.04-b05
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_422-8u422-b05-1~20.04-b05
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7081/1/testReport/
Max. process+thread count 3134 (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-7081/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.

Copy link
Contributor

@jojochuang jojochuang left a comment

Choose a reason for hiding this comment

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

Make sense to me. There's a checkstyle warning but glad it's not a big change.
Are you finding other issues with JDK23? I know it's just come out this month.

@jbrinegar
Copy link
Author

I am happy to report no other issues. This Subject usage in hadoop-common impacts a great many projects, so -Djava.security.manager=allow had to be sprinkled around to get things booting on Java 23.

@jojochuang
Copy link
Contributor

Ok sounds like we should get it backported to 3.4.x and 3.3.x too.

@jbrinegar jbrinegar changed the title HADOOP-19293. Avoid Subject.getSubject method on newer JVMs HADOOP-19212. Avoid Subject.getSubject method on newer JVMs Oct 2, 2024
@jbrinegar
Copy link
Author

@steveloughran PR for HADOOP-19212. I updated the title to reflect the duplicate change.

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.

this is great! we'd been warned about this but nobody had written the code.

I've made some comments. Can you also change the title to that of the previous JIRA on this. Thanks


GetSubjectNg() {
try {
currentMethod = Subject.class.getMethod("current");
Copy link
Contributor

Choose a reason for hiding this comment

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

Use DynMethods

Copy link
Author

Choose a reason for hiding this comment

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

This class, and all classes added in this PR, are in the hadoop-auth module because Subject.getSubject is used in both hadoop-auth (KerberosAuthenticator) and hadoop-common (UserGroupInformation). hadoop-common depends on hadoop-auth, so that seemed like a reasonable fit.

DynMethods, however, resides in hadoop-common, and thus it cannot be used in hadoop-auth.

How would you like me to proceed?

static {
int version = 0;
try {
version = Integer.parseInt(System.getProperty("java.specification.version"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Use Shell.isJavaVersionAtLeast(18)

Copy link
Author

Choose a reason for hiding this comment

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

My comment about dependencies applies to Shell as well. Let me know how you'd like to proceed with this one as well.

@jbrinegar
Copy link
Author

@steveloughran thank you for the review. I have pushed a second commit that addresses feedback marked with 👍. The title of this PR was updated to include "HADOOP-19212." as a prefix. I am happy to rebase/squash once review is complete, if squashing is necessary.

Due to dependencies, I cannot use DynMethods and Shell, and so those requests are not completed. Let me know how you wish for me to proceed there.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 17m 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 appears to include 1 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 59s Maven dependency ordering for branch
+1 💚 mvninstall 37m 16s trunk passed
+1 💚 compile 20m 6s trunk passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 compile 18m 50s trunk passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 checkstyle 1m 27s trunk passed
+1 💚 mvnsite 2m 31s trunk passed
+1 💚 javadoc 2m 3s trunk passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javadoc 1m 34s trunk passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 spotbugs 3m 36s trunk passed
+1 💚 shadedclient 48m 24s branch has no errors when building and testing our client artifacts.
-0 ⚠️ patch 48m 51s 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 19s the patch passed
+1 💚 compile 19m 7s the patch passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javac 19m 7s the patch passed
+1 💚 compile 18m 12s the patch passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 javac 18m 12s 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 53 new + 73 unchanged - 0 fixed = 126 total (was 73)
+1 💚 mvnsite 2m 27s the patch passed
+1 💚 javadoc 1m 55s the patch passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javadoc 1m 33s the patch passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 spotbugs 3m 54s the patch passed
+1 💚 shadedclient 42m 43s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 3m 28s hadoop-auth in the patch passed.
+1 💚 unit 19m 32s hadoop-common in the patch passed.
+1 💚 asflicense 1m 4s The patch does not generate ASF License warnings.
286m 44s
Subsystem Report/Notes
Docker ClientAPI=1.47 ServerAPI=1.47 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7081/2/artifact/out/Dockerfile
GITHUB PR #7081
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 37e27de92584 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / e25881e
Default Java Private Build-1.8.0_422-8u422-b05-1~20.04-b05
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_422-8u422-b05-1~20.04-b05
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7081/2/testReport/
Max. process+thread count 3134 (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-7081/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.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 17m 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 15m 11s Maven dependency ordering for branch
+1 💚 mvninstall 36m 57s trunk passed
+1 💚 compile 19m 59s trunk passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 compile 18m 16s trunk passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 checkstyle 1m 24s trunk passed
+1 💚 mvnsite 2m 29s trunk passed
+1 💚 javadoc 2m 5s trunk passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javadoc 1m 33s trunk passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 spotbugs 3m 36s trunk passed
+1 💚 shadedclient 41m 55s branch has no errors when building and testing our client artifacts.
-0 ⚠️ patch 42m 23s 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 19s the patch passed
+1 💚 compile 19m 5s the patch passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javac 19m 5s the patch passed
+1 💚 compile 18m 8s the patch passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 javac 18m 8s 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 53 new + 73 unchanged - 0 fixed = 126 total (was 73)
+1 💚 mvnsite 2m 26s the patch passed
+1 💚 javadoc 1m 57s the patch passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javadoc 1m 34s the patch passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 spotbugs 3m 50s the patch passed
+1 💚 shadedclient 42m 24s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 3m 29s hadoop-auth in the patch passed.
+1 💚 unit 19m 37s hadoop-common in the patch passed.
+1 💚 asflicense 1m 4s The patch does not generate ASF License warnings.
278m 55s
Subsystem Report/Notes
Docker ClientAPI=1.47 ServerAPI=1.47 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7081/3/artifact/out/Dockerfile
GITHUB PR #7081
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 9fc8ff5d88eb 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / e6e9bd2
Default Java Private Build-1.8.0_422-8u422-b05-1~20.04-b05
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_422-8u422-b05-1~20.04-b05
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7081/3/testReport/
Max. process+thread count 1294 (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-7081/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.

Copy link
Member

@pan3793 pan3793 left a comment

Choose a reason for hiding this comment

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

lgtm except for 2 minor issues.

@AlanBateman
Copy link

JEP 486: Permanently Disable the Security Manager is on the JDK's technical roadmap. As part of the changes (PR in review) will be for Subject.current to throw unconditionally, meaning the workaround to allow a SecurityManager will no longer work. So the timing of the PR here is good.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 38m 36s 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 16m 22s Maven dependency ordering for branch
-1 ❌ mvninstall 5m 38s /branch-mvninstall-root.txt root in trunk failed.
+1 💚 compile 36m 52s trunk passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
-1 ❌ compile 9m 6s /branch-compile-root-jdkPrivateBuild-1.8.0_422-8u422-b05-1~20.04-b05.txt root in trunk failed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05.
+1 💚 checkstyle 1m 58s trunk passed
+1 💚 mvnsite 3m 45s trunk passed
+1 💚 javadoc 3m 7s trunk passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javadoc 2m 14s trunk passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 spotbugs 4m 52s trunk passed
+1 💚 shadedclient 47m 24s branch has no errors when building and testing our client artifacts.
-0 ⚠️ patch 47m 51s 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 20s the patch passed
+1 💚 compile 19m 36s the patch passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javac 19m 36s the patch passed
+1 💚 compile 17m 59s the patch passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 javac 17m 59s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 1m 26s /results-checkstyle-hadoop-common-project.txt hadoop-common-project: The patch generated 46 new + 73 unchanged - 0 fixed = 119 total (was 73)
+1 💚 mvnsite 2m 26s the patch passed
+1 💚 javadoc 1m 56s the patch passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javadoc 1m 35s the patch passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 spotbugs 3m 56s the patch passed
+1 💚 shadedclient 42m 48s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 3m 29s hadoop-auth in the patch passed.
+1 💚 unit 19m 35s hadoop-common in the patch passed.
+1 💚 asflicense 1m 4s The patch does not generate ASF License warnings.
288m 31s
Subsystem Report/Notes
Docker ClientAPI=1.47 ServerAPI=1.47 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7081/4/artifact/out/Dockerfile
GITHUB PR #7081
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux d3c644186516 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 4325f46
Default Java Private Build-1.8.0_422-8u422-b05-1~20.04-b05
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_422-8u422-b05-1~20.04-b05
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7081/4/testReport/
Max. process+thread count 3098 (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-7081/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.

@jbrinegar
Copy link
Author

I am not sure I have the permissions to retrigger the failing checks. Ultimate failure was on the remote side:

[WARNING] c++: fatal error: cannot execute ‘as’: vfork: Resource temporarily unavailable
[WARNING] compilation terminated.
[WARNING] make[2]: *** [main/native/libhdfspp/tests/CMakeFiles/user_lock_test.dir/build.make:63: main/native/libhdfspp/tests/CMakeFiles/user_lock_test.dir/user_lock_test.cc.o] Error 1

This java code compiles just fine:

[INFO] Reactor Summary for Apache Hadoop Common Project 3.5.0-SNAPSHOT:
[INFO]
[INFO] Apache Hadoop Annotations .......................... SUCCESS [  0.710 s]
[INFO] Apache Hadoop MiniKDC .............................. SUCCESS [  0.271 s]
[INFO] Apache Hadoop Auth ................................. SUCCESS [  0.769 s]
[INFO] Apache Hadoop Auth Examples ........................ SUCCESS [  0.094 s]
[INFO] Apache Hadoop Common ............................... SUCCESS [ 36.642 s]
[INFO] Apache Hadoop NFS .................................. SUCCESS [  7.181 s]
[INFO] Apache Hadoop KMS .................................. SUCCESS [  0.227 s]
[INFO] Apache Hadoop Registry ............................. SUCCESS [  0.439 s]
[INFO] Apache Hadoop Common Project ....................... SUCCESS [  0.018 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  46.854 s
[INFO] Finished at: 2024-10-16T16:54:14-04:00
[INFO] ------------------------------------------------------------------------

// how getSubject operates depends on the JVM calling it.
// asserting that it does not throw is a valid test, especially on Java 18 and above
// prior to Java 18, this method is just a simple wrapper
assertDoesNotThrow(() -> SubjectAdapter.getSubject());
Copy link
Contributor

Choose a reason for hiding this comment

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

Use our LambdaTestUtils.intercept() here as it fails better, can validates the type and message

/**
* Indirectly calls Subject.current(), which exists in Java 18 and above only
*/
class SubjectAdapterJava18AndAbove implements HiddenSubjectAdapter {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use our new DynMethods classes, (which we copied from parquet and which is also found in iceberg). It fails better and as it is so common it's good to get familiar with it

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.

6 participants