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

DRILL-5876: Remove netty-tcnative dependency from java-exec/pom.xml #991

Closed
wants to merge 2 commits into from

Conversation

parthchandra
Copy link
Contributor

Commented out the netty-tcnative dependency. Tested build on command line, intellij. Ran unit tests.
@paul-rogers, @vrozov Can you guys please review?

<version>1.5.0.Final</version>
</extension>
</extensions>
<!-- Uncomment the following to get a debug build that allows openssl support -->
Copy link
Member

Choose a reason for hiding this comment

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

Can it be in a separate profile (openssl) that is disabled by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How would that work in conjunction with the main pom's profiles? I would want to have both the (apache | mapr | cdh | hdp) profile and the openssl profile enabled.

Copy link
Member

Choose a reason for hiding this comment

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

For example `-P apache,openssl'. Another option will be to enable openssl profile based on a property.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about we forget the whole os dependent stuff and put in all the variants (there are only four) and make the scope for all of them provided?
Since netty is internally loading the correct jar based on the os, all we need to do is make sure that the jar files are in the classpath.

Copy link
Member

Choose a reason for hiding this comment

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

Looking at netty code it seems to use Class.forName("io.netty.internal.tcnative.SSL", false, OpenSsl.class.getClassLoader()); (see OpenSsl), so if all netty-tcnative OS dependent jars are on the classpath, it should load the first in the classpath (if delegated to the system classloader) or one that OpenSsl classloader finds. My understanding is that OpenSsl class is loaded by the system classloader (I may be wrong), but in this case, having all variants of netty-tcnative on the classpath, will not resolve the issue as netty will try to load "io.netty.internal.tcnative.SSL" class only from one of the jars and if it happens to be a wrong jar, will disable OpenSsl functionality.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. So I tried to put the commented out code in a 'openssl' profile and discovered that maven does not allow the tag inside a profile. Since the problem is essentially caused by this extension being included, not being able to put it in the 'openssl' profile makes this useless.
There is a sort of a convoluted hack around this described here: https://stackoverflow.com/questions/17639778/maven-3-profile-with-extensions.
IMO this introduces a bit of unreadable, magical stuff in the pom which I would rather avoid.
What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Sounds like a hack. I'd recommend to keep it commented out or try .mvn/extensions.xml solution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the PR with the latest recommendations. Using a different profile seems to work well.

detection plugin. Include netty-tcnative only if the openssl profile is
enabled. netty-tcnative is no longer provided scope see it is included specifically in a profile.

DRILL-5876: Update comment
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative</artifactId>
<version>2.0.1.Final</version>
Copy link
Member

Choose a reason for hiding this comment

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

Please add provided scope.

@@ -22,7 +22,10 @@
<libpam4j.version>1.8-rev1</libpam4j.version>
<!-- Configure the os-maven-plugin extension to expand the classifier on -->
<!-- Fedora-"like" systems. Used for netty-tcnative inclusion -->
<!-- Uncomment the following to get a debug build that allows openssl support -->
Copy link
Member

Choose a reason for hiding this comment

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

Please uncomment (should be harmful) or move to openssl profile.

@parthchandra
Copy link
Contributor Author

@vrozov per your other tests, this is still broken for eclipse. So it seems that the best bet is to comment out the dependency and the os extension. Developers needing to debug, will need to uncomment the dependency.
I will remove the additional commit.

@parthchandra
Copy link
Contributor Author

@vrozov your proposed solution is better and works for intellij and eclipse. Closing this PR and will wait for you to submit a new PR.
Thanks!!

@vrozov
Copy link
Member

vrozov commented Oct 20, 2017

@parthchandra open PR #1004

@parthchandra parthchandra deleted the DRILL-5876 branch January 2, 2018 19:57
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.

None yet

2 participants