Skip to content

Conversation

@sunchao
Copy link
Member

@sunchao sunchao commented Oct 23, 2020

In HADOOP-15832 we excluded org.bouncycastle from the shaded client jars but still relocate them to org.apache.hadoop.shaded. This breaks any downstream application that wants to use MiniYARNCluster from hadoop-client-minicluster since there is no way to bring its own org.bouncycastle test dependency.

Error:  Caused by: sbt.ForkMain$ForkError: java.lang.ClassNotFoundException: org.apache.hadoop.shaded.org.bouncycastle.operator.OperatorCreationException
Error:  	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
Error:  	at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
Error:  	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
Error:  	at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
Error:  	at org.apache.hadoop.yarn.server.resourcemanager.ResourceManager$RMActiveServices.serviceInit(ResourceManager.java:862)
Error:  	at org.apache.hadoop.service.AbstractService.init(AbstractService.java:164)
Error:  	at org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.createAndInitActiveServices(ResourceManager.java:1296)
Error:  	at org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.serviceInit(ResourceManager.java:339)
Error:  	at org.apache.hadoop.service.AbstractService.init(AbstractService.java:164)
Error:  	at org.apache.hadoop.yarn.server.MiniYARNCluster.initResourceManager(MiniYARNCluster.java:353)
Error:  	at org.apache.hadoop.yarn.server.MiniYARNCluster.access$200(MiniYARNCluster.java:127)
Error:  	at org.apache.hadoop.yarn.server.MiniYARNCluster$ResourceManagerWrapper.serviceInit(MiniYARNCluster.java:488)
Error:  	at org.apache.hadoop.service.AbstractService.init(AbstractService.java:164)
Error:  	at org.apache.hadoop.service.CompositeService.serviceInit(CompositeService.java:109)
Error:  	at org.apache.hadoop.yarn.server.MiniYARNCluster.serviceInit(MiniYARNCluster.java:321)
Error:  	at org.apache.hadoop.service.AbstractService.init(AbstractService.java:164)
Error:  	at org.apache.spark.deploy.yarn.BaseYarnClusterSuite.beforeAll(BaseYarnClusterSuite.scala:94)
Error:  	at org.scalatest.BeforeAndAfterAll.liftedTree1$1(BeforeAndAfterAll.scala:212)
Error:  	at org.scalatest.BeforeAndAfterAll.run(BeforeAndAfterAll.scala:210)
Error:  	at org.scalatest.BeforeAndAfterAll.run$(BeforeAndAfterAll.scala:208)
Error:  	at org.apache.spark.SparkFunSuite.run(SparkFunSuite.scala:61)
Error:  	at org.scalatest.tools.Framework.org$scalatest$tools$Framework$$runSuite(Framework.scala:318)
Error:  	at org.scalatest.tools.Framework$ScalaTestTask.execute(Framework.scala:513)
Error:  	at sbt.ForkMain$Run.lambda$runTest$1(ForkMain.java:413)
Error:  	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
Error:  	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
Error:  	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
Error:  	at java.lang.Thread.run(Thread.java:748)

This fixes the issue by excluding org.bouncycastle from relocation.

@sunchao
Copy link
Member Author

sunchao commented Oct 24, 2020

cc @steveloughran @jojochuang @aajisaka - could you please take a look? thanks!

@jojochuang
Copy link
Contributor

I'm also looking at shading issues at the same time. Mvn verify is broken in trunk otherwise I would ask you to run...

I'm not sure I understand the use case here. Is the MiniYARNCluster simply broken out of box? Or that Spark wants to test using MiniYARNCluster but substitue a custom version of BouncyCastle?

Our client jar contains only one IT ITUseMiniCluster and it checks only hdfs and webhdfs clients. How about adding an IT for MiniYARNCluster?

@sunchao
Copy link
Member Author

sunchao commented Oct 24, 2020

I'm not sure I understand the use case here. Is the MiniYARNCluster simply broken out of box? Or that Spark wants to test using MiniYARNCluster but substitue a custom version of BouncyCastle?

Yes I'd say it's broken out of box since 3.3.0: there are two issues, this one and HADOOP-17327. Spark doesn't use a custom version but since bouncycastle is relocated and not shaded, there is no way for Spark to introduce the dependency, so this never works ...

Our client jar contains only one IT ITUseMiniCluster and it checks only hdfs and webhdfs clients. How about adding an IT for MiniYARNCluster?

This is a good suggestion, thanks. I'll perhaps add it in HADOOP-17327 since without MiniYARNCluster won't work without both being resolved.

@steveloughran
Copy link
Contributor

makes sense, especially given bouncy-castle's export nature...it's a special module.
A test will defend against regression.

.build();
cluster.waitActive();

conf.set("yarn.scheduler.capacity.root.queues", "default");
Copy link
Member Author

Choose a reason for hiding this comment

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

another issue: we currently don't bundle YARN test resources like capacity-scheduler.xml in hadoop-client-minicluster so this is a temporary workaround. I'll open another JIRA for this later.

Copy link
Contributor

Choose a reason for hiding this comment

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

we leave out all of test/resources to stop log4j files, site configs etc getting onto the classpath of apps downstream -so making it impossible for them to choose their own options

Copy link
Member Author

Choose a reason for hiding this comment

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

maybe we should include them for test-only purpose? I think hadoop-client-minicluster should always be test scope right?

Copy link
Contributor

Choose a reason for hiding this comment

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

it may be test only, but the other test suite may have its own configs that it wants. If we put them in the test JAR, it becomes near impossible to change. People will hate us (more)

@sunchao
Copy link
Member Author

sunchao commented Oct 26, 2020

Thanks. I added a test for this. Note as mentioned previously, this will fail currently because of HADOOP-17327.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 29m 6s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 0m 0s test4tests The patch appears to include 2 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 15m 16s Maven dependency ordering for branch
+1 💚 mvninstall 20m 40s trunk passed
+1 💚 compile 0m 28s trunk passed with JDK Ubuntu-11.0.9+11-Ubuntu-0ubuntu1.18.04.1
+1 💚 compile 0m 28s trunk passed with JDK Private Build-1.8.0_272-8u272-b10-0ubuntu1~18.04-b10
+1 💚 checkstyle 0m 28s trunk passed
+1 💚 mvnsite 2m 25s trunk passed
+1 💚 shadedclient 14m 57s branch has no errors when building and testing our client artifacts.
+1 💚 javadoc 2m 20s trunk passed with JDK Ubuntu-11.0.9+11-Ubuntu-0ubuntu1.18.04.1
+1 💚 javadoc 2m 17s trunk passed with JDK Private Build-1.8.0_272-8u272-b10-0ubuntu1~18.04-b10
+0 🆗 spotbugs 0m 27s Used deprecated FindBugs config; considering switching to SpotBugs.
+0 🆗 findbugs 0m 31s branch/hadoop-client-modules/hadoop-client-api no findbugs output file (findbugsXml.xml)
+0 🆗 findbugs 0m 27s branch/hadoop-client-modules/hadoop-client-runtime no findbugs output file (findbugsXml.xml)
+0 🆗 findbugs 0m 28s branch/hadoop-client-modules/hadoop-client-minicluster no findbugs output file (findbugsXml.xml)
+0 🆗 findbugs 0m 28s branch/hadoop-client-modules/hadoop-client-check-test-invariants no findbugs output file (findbugsXml.xml)
+0 🆗 findbugs 0m 27s branch/hadoop-client-modules/hadoop-client-integration-tests no findbugs output file (findbugsXml.xml)
_ Patch Compile Tests _
+0 🆗 mvndep 0m 35s Maven dependency ordering for patch
+1 💚 mvninstall 10m 13s the patch passed
+1 💚 compile 0m 18s the patch passed with JDK Ubuntu-11.0.9+11-Ubuntu-0ubuntu1.18.04.1
+1 💚 javac 0m 18s the patch passed
+1 💚 compile 0m 18s the patch passed with JDK Private Build-1.8.0_272-8u272-b10-0ubuntu1~18.04-b10
+1 💚 javac 0m 18s the patch passed
-0 ⚠️ checkstyle 0m 16s /diff-checkstyle-hadoop-client-modules.txt hadoop-client-modules: The patch generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
+1 💚 mvnsite 1m 30s the patch passed
+1 💚 shellcheck 0m 0s There were no new shellcheck issues.
+1 💚 shelldocs 0m 18s The patch generated 0 new + 104 unchanged - 132 fixed = 104 total (was 236)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 xml 0m 6s The patch has no ill-formed XML file.
+1 💚 shadedclient 15m 3s patch has no errors when building and testing our client artifacts.
+1 💚 javadoc 1m 52s the patch passed with JDK Ubuntu-11.0.9+11-Ubuntu-0ubuntu1.18.04.1
+1 💚 javadoc 1m 48s the patch passed with JDK Private Build-1.8.0_272-8u272-b10-0ubuntu1~18.04-b10
+0 🆗 findbugs 0m 21s hadoop-client-modules/hadoop-client-api has no data from findbugs
+0 🆗 findbugs 0m 22s hadoop-client-modules/hadoop-client-runtime has no data from findbugs
+0 🆗 findbugs 0m 23s hadoop-client-modules/hadoop-client-minicluster has no data from findbugs
+0 🆗 findbugs 0m 21s hadoop-client-modules/hadoop-client-check-test-invariants has no data from findbugs
+0 🆗 findbugs 0m 21s hadoop-client-modules/hadoop-client-integration-tests has no data from findbugs
_ Other Tests _
+1 💚 unit 0m 21s hadoop-client-api in the patch passed.
+1 💚 unit 0m 22s hadoop-client-runtime in the patch passed.
+1 💚 unit 0m 22s hadoop-client-minicluster in the patch passed.
+1 💚 unit 0m 21s hadoop-client-check-test-invariants in the patch passed.
+1 💚 unit 0m 21s hadoop-client-integration-tests in the patch passed.
+1 💚 asflicense 0m 36s The patch does not generate ASF License warnings.
130m 40s
Subsystem Report/Notes
Docker ClientAPI=1.40 ServerAPI=1.40 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-2411/3/artifact/out/Dockerfile
GITHUB PR #2411
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient xml shellcheck shelldocs findbugs checkstyle
uname Linux ccf860621740 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 2cb9e8f
Default Java Private Build-1.8.0_272-8u272-b10-0ubuntu1~18.04-b10
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.9+11-Ubuntu-0ubuntu1.18.04.1 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_272-8u272-b10-0ubuntu1~18.04-b10
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-2411/3/testReport/
Max. process+thread count 721 (vs. ulimit of 5500)
modules C: hadoop-client-modules/hadoop-client-api hadoop-client-modules/hadoop-client-runtime hadoop-client-modules/hadoop-client-minicluster hadoop-client-modules/hadoop-client-check-test-invariants hadoop-client-modules/hadoop-client-integration-tests U: hadoop-client-modules
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-2411/3/console
versions git=2.17.1 maven=3.6.0 shellcheck=0.4.6
Powered by Apache Yetus 0.13.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

@sunchao
Copy link
Member Author

sunchao commented Nov 4, 2020

@jojochuang @steveloughran added a unit test for this - can you take another look? thanks.

@apache apache deleted a comment from hadoop-yetus Nov 9, 2020
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.

looks good, just a few details of the test case to sort out

import org.apache.hadoop.hdfs.web.WebHdfsTestUtil;
import org.apache.hadoop.hdfs.web.WebHdfsConstants;

import org.apache.hadoop.yarn.server.MiniYARNCluster;
Copy link
Contributor

Choose a reason for hiding this comment

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

should go straight after line 45 - no gap

Copy link
Member Author

Choose a reason for hiding this comment

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

will fix. I was trying to follow the existing style though which separates imports based on package.


import org.apache.hadoop.yarn.server.MiniYARNCluster;

import static org.junit.Assert.assertTrue;
Copy link
Contributor

Choose a reason for hiding this comment

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

unused, according to checkstyle

.build();
cluster.waitActive();

conf.set("yarn.scheduler.capacity.root.queues", "default");
Copy link
Contributor

Choose a reason for hiding this comment

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

we leave out all of test/resources to stop log4j files, site configs etc getting onto the classpath of apps downstream -so making it impossible for them to choose their own options

if (cluster != null) {
cluster.close();
}
if (yarnCluster != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

all services are closeable, so use IOUtil.cleanupWithLogger() & let it handle null checks and exceptions

Copy link
Member Author

@sunchao sunchao Nov 9, 2020

Choose a reason for hiding this comment

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

Nice. Didn't know this util method, but seems we can only use it with yarnCluster.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 1m 29s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 0m 0s test4tests The patch appears to include 2 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 15m 0s Maven dependency ordering for branch
+1 💚 mvninstall 25m 54s trunk passed
+1 💚 compile 0m 24s trunk passed with JDK Ubuntu-11.0.9+11-Ubuntu-0ubuntu1.18.04.1
+1 💚 compile 0m 21s trunk passed with JDK Private Build-1.8.0_272-8u272-b10-0ubuntu1~18.04-b10
+1 💚 checkstyle 0m 22s trunk passed
+1 💚 mvnsite 1m 54s trunk passed
+1 💚 shadedclient 16m 37s branch has no errors when building and testing our client artifacts.
+1 💚 javadoc 1m 48s trunk passed with JDK Ubuntu-11.0.9+11-Ubuntu-0ubuntu1.18.04.1
+1 💚 javadoc 1m 50s trunk passed with JDK Private Build-1.8.0_272-8u272-b10-0ubuntu1~18.04-b10
+0 🆗 spotbugs 0m 23s Used deprecated FindBugs config; considering switching to SpotBugs.
+0 🆗 findbugs 0m 25s branch/hadoop-client-modules/hadoop-client-api no findbugs output file (findbugsXml.xml)
+0 🆗 findbugs 0m 21s branch/hadoop-client-modules/hadoop-client-runtime no findbugs output file (findbugsXml.xml)
+0 🆗 findbugs 0m 23s branch/hadoop-client-modules/hadoop-client-minicluster no findbugs output file (findbugsXml.xml)
+0 🆗 findbugs 0m 21s branch/hadoop-client-modules/hadoop-client-check-test-invariants no findbugs output file (findbugsXml.xml)
+0 🆗 findbugs 0m 23s branch/hadoop-client-modules/hadoop-client-integration-tests no findbugs output file (findbugsXml.xml)
_ Patch Compile Tests _
+0 🆗 mvndep 0m 36s Maven dependency ordering for patch
+1 💚 mvninstall 12m 55s the patch passed
+1 💚 compile 0m 16s the patch passed with JDK Ubuntu-11.0.9+11-Ubuntu-0ubuntu1.18.04.1
+1 💚 javac 0m 16s the patch passed
+1 💚 compile 0m 17s the patch passed with JDK Private Build-1.8.0_272-8u272-b10-0ubuntu1~18.04-b10
+1 💚 javac 0m 17s the patch passed
+1 💚 checkstyle 0m 15s the patch passed
+1 💚 mvnsite 1m 16s the patch passed
+1 💚 shellcheck 0m 1s There were no new shellcheck issues.
+1 💚 shelldocs 0m 14s The patch generated 0 new + 104 unchanged - 132 fixed = 104 total (was 236)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 xml 0m 6s The patch has no ill-formed XML file.
+1 💚 shadedclient 17m 11s patch has no errors when building and testing our client artifacts.
+1 💚 javadoc 1m 30s the patch passed with JDK Ubuntu-11.0.9+11-Ubuntu-0ubuntu1.18.04.1
+1 💚 javadoc 1m 30s the patch passed with JDK Private Build-1.8.0_272-8u272-b10-0ubuntu1~18.04-b10
+0 🆗 findbugs 0m 20s hadoop-client-modules/hadoop-client-api has no data from findbugs
+0 🆗 findbugs 0m 19s hadoop-client-modules/hadoop-client-runtime has no data from findbugs
+0 🆗 findbugs 0m 18s hadoop-client-modules/hadoop-client-minicluster has no data from findbugs
+0 🆗 findbugs 0m 19s hadoop-client-modules/hadoop-client-check-test-invariants has no data from findbugs
+0 🆗 findbugs 0m 19s hadoop-client-modules/hadoop-client-integration-tests has no data from findbugs
_ Other Tests _
+1 💚 unit 0m 17s hadoop-client-api in the patch passed.
+1 💚 unit 0m 19s hadoop-client-runtime in the patch passed.
+1 💚 unit 0m 18s hadoop-client-minicluster in the patch passed.
+1 💚 unit 0m 17s hadoop-client-check-test-invariants in the patch passed.
+1 💚 unit 0m 17s hadoop-client-integration-tests in the patch passed.
+1 💚 asflicense 0m 34s The patch does not generate ASF License warnings.
110m 33s
Subsystem Report/Notes
Docker ClientAPI=1.40 ServerAPI=1.40 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-2411/4/artifact/out/Dockerfile
GITHUB PR #2411
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient xml shellcheck shelldocs findbugs checkstyle
uname Linux 6db97700c318 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 1ea3f74
Default Java Private Build-1.8.0_272-8u272-b10-0ubuntu1~18.04-b10
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.9+11-Ubuntu-0ubuntu1.18.04.1 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_272-8u272-b10-0ubuntu1~18.04-b10
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-2411/4/testReport/
Max. process+thread count 511 (vs. ulimit of 5500)
modules C: hadoop-client-modules/hadoop-client-api hadoop-client-modules/hadoop-client-runtime hadoop-client-modules/hadoop-client-minicluster hadoop-client-modules/hadoop-client-check-test-invariants hadoop-client-modules/hadoop-client-integration-tests U: hadoop-client-modules
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-2411/4/console
versions git=2.17.1 maven=3.6.0 shellcheck=0.4.6
Powered by Apache Yetus 0.13.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

@apache apache deleted a comment from hadoop-yetus Nov 10, 2020
@steveloughran steveloughran merged commit 2522bf2 into apache:trunk Nov 10, 2020
@steveloughran
Copy link
Contributor

committed to trunk. Is this needed on branch-3.3 too?

@sunchao
Copy link
Member Author

sunchao commented Nov 10, 2020

Thanks @steveloughran ! yes please backport it to branch-3.3 as well.

@dongjoon-hyun
Copy link
Member

Thanks! Could you update the JIRA Fixed Version accordingly?

@sunchao
Copy link
Member Author

sunchao commented Nov 11, 2020

Sure @dongjoon-hyun - updated. I'll backport this to branch-3.3 also later.

sunchao added a commit that referenced this pull request Nov 11, 2020
@steveloughran
Copy link
Contributor

seen this is merged in. @sunchao -you got a GPG key in KEYS yet? Be good to GPG sign your patches. Github does it for the web ui ones, but we have to do it ourselves on the cherrypicks

@sunchao
Copy link
Member Author

sunchao commented Nov 11, 2020

@steveloughran you mean in https://dist.apache.org/repos/dist/release/hadoop/common/KEYS ? no I haven't done that yet. Thanks for the info, do you know any doc to walk through this?

@steveloughran
Copy link
Contributor

My two aliases for showing commit info; lg is the one I normally log with

# log with indicator of trust
alias.lg=log --date=relative --color --graph --pretty=format:'%Cred%h%Creset %C(blue)%G?%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold yellow)<%an>%Creset %C(cyan)<%cn>%Creset' --abbrev-commit


# log with full GPG signature infor
alias.log1s=log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative --show-signature

Now, if you go through history (e.g. branch-2.8) you'll come across a GPG key I had to revoke; the yubikey keygen turned out to be broken. Git doesn't really handle that well.

@sunchao
Copy link
Member Author

sunchao commented Nov 12, 2020

Thanks @steveloughran , the commands look better than mine so I'll take them. I can sign my future cherry-picks. Question though: where should I add my public key? should it added into https://dist.apache.org/repos/dist/release/hadoop/common/KEYS? sorry not very familiar with this process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants