GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Shade Netty transport by ejona86 · Pull Request #2485 · grpc/grpc-java

Conversation

@ejona86

@ejona86 ejona86 commented Dec 5, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

The entire transport is shaded because we wouldn't want to collide with
the unshaded form of grpc-netty.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jhspaybar

jhspaybar commented Dec 8, 2016

Copy link
Copy Markdown
Contributor

So this means that gRPC netty will no longer have a chance to conflict with other Netty versions I'm using? If so, +1, we were thinking of doing this ourselves when we imported and used gRPC anyways. The http2 changes between 4.1.5.Final and 4.1.6.Final were frustrating and it happens often enough to cause issues in a big organization.

How will this play with shared things like worker groups and whatnot? If I have normal Netty plus grpc Netty, can I use the same worker group between them, or will I likely be stuck with 2 worker groups due to the relocation of classes?

quidryan reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ejona86

ejona86 commented Dec 8, 2016

Copy link
Copy Markdown
Member Author

Yes, this would remove or reduce the risk of conflicting Netty versions (depending on whether we continue to shade all of Netty, or just a risky subportion).

The two Nettys currently share no code, so you'd have to use different EventLoops. "Normally" we could just shade the HTTP/2 codec. However, the HTTP/2 codec uses code from internal Netty classes that have no API stability. The internal classes then need all of Netty to be shaded. It may be possible to shade just some of the internal classes and the HTTP/2 codec, but it seems a bit dangerous.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jhspaybar

jhspaybar commented Dec 8, 2016

Copy link
Copy Markdown
Contributor

Okay, that was the outcome we had evaluated as well internally. We feel the risk of breakage due to dependency conflicts is greater than the cost of not being able to use a single shared event loop for all netty's. We are in support of a complete shading of all netty code, not just http2.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nevi-me

nevi-me commented Jan 9, 2017

Copy link
Copy Markdown

I tried using gRPC with Apache Spark, and it was working well while developing on local Windows machine (running with IntelliJ), but when I try running my fatJar on Apache Spark, I get Netty related issues.

Is this something that shading would be able to resolve?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ejona86

ejona86 commented Jan 9, 2017

Copy link
Copy Markdown
Member Author

I get Netty related issues

That is too vague to tell you anything. If it was Netty version incompatibilities, then yes, shading would likely resolve the problem.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@zackangelo

zackangelo commented Jan 12, 2017

Copy link
Copy Markdown

Netty conflicts have bitten us pretty hard internally during our gRPC pilot. A shaded dependency would be very welcome on our team.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ejona86

ejona86 commented Jan 24, 2017

Copy link
Copy Markdown
Member Author

Jenkins, retest this please.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nevi-me

nevi-me commented Jan 24, 2017

Copy link
Copy Markdown

That is too vague to tell you anything. If it was Netty version incompatibilities, then yes, shading would likely resolve the problem.

I missed this, I tried reproducing the exact error, but dealing with other nonsense now 😞

Essentially, Spark was complaining about a clash with class names, I know I'm still being vague, but hopefully I'll be able to get someone in my team to reproduce the error in the coming days.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ejona86

ejona86 commented Jan 27, 2017

Copy link
Copy Markdown
Member Author

@nevi-me, if it is similar to googleapis/google-cloud-java#1522 then it would be resolved. The root error there is a NoSuchMethodError, which is caused by version incompatibility.

nevi-me reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ejona86 ejona86 mentioned this pull request Jan 27, 2017
Using Pub/Sub JAVA client in play framework 2.5 - netty conflicts googleapis/google-cloud-java#1331
Closed
@jhspaybar

jhspaybar commented Feb 2, 2017

Copy link
Copy Markdown
Contributor

This is becoming a pretty significant source of pain for us. Is this something we think would be included in the 1.2 release(or even a 1.1.x release if possible)? I'd like to determine if this is for sure going to happen so it then becomes a discussion of when, or if we should be shading this ourselves internally if the decision is no. Thanks.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@garrettjonesgoogle

garrettjonesgoogle commented Feb 9, 2017

Copy link
Copy Markdown
Contributor

@ejona86 1.0 -> 1.1 is a minor version change, but a deleted method is a breaking change, which is inconsistent it being a minor version change.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kuroneko25

kuroneko25 commented Feb 9, 2017

Copy link
Copy Markdown

+1 on including this in 1.1.x release. This is currently preventing us from upgrading from 1.0 to 1.1.

jorgheymans reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ejona86

ejona86 commented Mar 10, 2017

Copy link
Copy Markdown
Member Author

@ejona86 1.0 -> 1.1 is a minor version change, but a deleted method is a breaking change, which is inconsistent it being a minor version change.

I assume you meant 4.0 → 4.1. The failure in logic is Netty is not using your semantics for versioning. Netty has lots of interfaces and it's my understanding they reserve the right to change them in minor versions. So upgrading minor versions isn't too hard, but is not 100% API compatible.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@zackangelo

zackangelo commented Mar 21, 2017

Copy link
Copy Markdown

@ejona86 are y'all still considering this? and if so, any idea when it'll land?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jhspaybar

jhspaybar commented May 3, 2017

Copy link
Copy Markdown
Contributor

@ejona86 Can you provide any updates on this? It would be helpful for a decision one way or the other. If gRPC will shade, that is our preference at Netflix, but if gRPC won't shade, we're likely to shade anyways when we import. Right now the limbo state is worst for us, because we don't want to shade and then have you do it anyways :)

quidryan reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nevi-me

nevi-me commented May 3, 2017

Copy link
Copy Markdown

@jhspaybar sorry for the amateur question, how would one shade the current version using Gradle?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jhspaybar

jhspaybar commented May 3, 2017

Copy link
Copy Markdown
Contributor

@nevi-me This thread has an accompanying commit which shows how.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nevi-me

nevi-me commented May 3, 2017

Copy link
Copy Markdown

Silly me, this is a PR haha. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ejona86

ejona86 commented May 3, 2017

Copy link
Copy Markdown
Member Author

@jhspaybar, as far as decisions go, having a version of grpc-netty that has Netty shaded is a "yes". We'll still have the unshaded one as well (and the two will use different package names). But I need to have time to finish the work. That will be "soon" (weeks).

jhspaybar and zackangelo reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vkedia

vkedia commented Jun 8, 2017

Copy link
Copy Markdown

@ejona86 Any updates on this?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@igorbernstein2 igorbernstein2 mentioned this pull request Jun 9, 2017
Upgrading grpc to 1.4.0 googleapis/java-bigtable-hbase#1395
Merged
@ejona86

ejona86 commented Jul 8, 2017

Copy link
Copy Markdown
Member Author

In netty/netty-tcnative#272, netty-tcnative began supporting shading. This needs to be updated to include tcnative, at which point it should be a fully self-contained one-stop-shop.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ejona86
ejona86 force-pushed the shade-netty branch from 9f7cd0b to 753994c Compare July 8, 2017 06:15
@ejona86

ejona86 commented Jul 12, 2017

Copy link
Copy Markdown
Member Author

I created netty/netty#6963 for discussing a out-of-the-box alternative to io.netty.packagePrefix.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ejona86

ejona86 commented Jul 21, 2017

Copy link
Copy Markdown
Member Author

Netty can now (in the next release) auto-detect the packagePrefix. That means this PR is very close.

Unfortunately, the shadow plugin is a bit strange when publishing. I need to investigate more how to upload to Maven Central (sanely) and how to install locally (sanely), when using the shadow plugin.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ejona86 ejona86 changed the title RFC: Shade Netty transport Shade Netty transport Jul 21, 2017
@igorbernstein2 igorbernstein2 mentioned this pull request Aug 4, 2017
netty-tcnative conflict, and using hadoop googleapis/java-bigtable-hbase#1475
Closed
@ejona86 ejona86 mentioned this pull request Aug 11, 2017
<RequestT,ResponseT>create(...) in MethodDescriptor has been deprecated #3332
Closed
@igorbernstein2 igorbernstein2 mentioned this pull request Aug 21, 2017
Shade tcnative & update grpc googleapis/java-bigtable-hbase#1487
Merged
@ejona86
ejona86 requested review from carl-mastrangelo and zhangkun83 August 29, 2017 02:08
@ejona86

ejona86 commented Aug 29, 2017

Copy link
Copy Markdown
Member Author

I'll need to rebase this now that we've updated Netty. The new Netty has minor tweaks to the file names that we need to shade. I hope the test catches that it is broken.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ejona86

ejona86 commented Aug 29, 2017

Copy link
Copy Markdown
Member Author

@carl-mastrangelo, @zhangkun83, please review. I imagine Carl is probably more comfortable with the Netty side and Kun is probably more comfortable with the Gradle side.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

carl-mastrangelo
carl-mastrangelo reviewed Aug 29, 2017
View reviewed changes
Comment thread netty/shaded/build.gradle Outdated
// We have to be careful with these replacements as they must not match any
// string in NativeLibraryLoader, else they cause corruption. Note that
// this includes concatenation of string literals and constants.
relocate 'META-INF/native/libnetty', 'META-INF/native/libio-grpc-netty-shaded-netty'

@carl-mastrangelo carl-mastrangelo Aug 29, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

These should be underscores. See https://github.com/netty/netty-tcnative/blob/master/openssl-dynamic/src/main/c/jnilib.c#L276

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ejona86 ejona86 Aug 29, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

In the version of master this is on, they must be dashes. This is what I as referring to with "I'll need to rebase this now that we've updated Netty. The new Netty has minor tweaks to the file names that we need to shade."

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ejona86 ejona86 Sep 15, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I've rebased on top of master. The tests correctly failed, and swapping to underscores lets them now pass.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
carl-mastrangelo
carl-mastrangelo reviewed Aug 31, 2017
View reviewed changes
Comment thread netty/shaded/src/testShadow/java/io/grpc/netty/shaded/ShadingTest.java Outdated
/** Test TLS since that verifies everything, including tcnative, is functional. */
@Test
public void tls() throws Exception {
Server server = ServerBuilder.forPort(0)

@carl-mastrangelo carl-mastrangelo Aug 31, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

If you are testing TLS, can you for the SslProvider to be SslProvider.OPENSSL?

Also, this test case should probably be split. It is testing two things: If the ServerLoader worked, and if tcnative was shaded properly.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ejona86 ejona86 Sep 8, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Done. Done.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread netty/shaded/src/testShadow/java/io/grpc/netty/shaded/ShadingTest.java
} finally {
server.shutdownNow();
}
}

@carl-mastrangelo carl-mastrangelo Aug 31, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Await termination?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ejona86 ejona86 Sep 8, 2017

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Done.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
zhangkun83
zhangkun83 approved these changes Sep 1, 2017
View reviewed changes
@ejona86

ejona86 commented Sep 14, 2017

Copy link
Copy Markdown
Member Author

@carl-mastrangelo, PTAL

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

carl-mastrangelo
carl-mastrangelo approved these changes Sep 14, 2017
View reviewed changes

@carl-mastrangelo carl-mastrangelo left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread netty/shaded/src/testShadow/java/io/grpc/netty/shaded/ShadingTest.java Outdated
public void tls() throws Exception {
Server server = ServerBuilder.forPort(0)
public void serviceLoaderFindsNetty() throws Exception {
assertTrue(ServerBuilder.forPort(0) instanceof NettyServerBuilder);

@carl-mastrangelo carl-mastrangelo Sep 14, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

optional: if you use Truth.assertThat(ServerBuilder.forPort(0)).isInstanceOf(NettyServerBuilder.class), a test failure will tell you what the instance actually was.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ejona86 ejona86 Sep 15, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I've swapped the tests to use Truth exclusively.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ejona86
ejona86 force-pushed the shade-netty branch 2 times, most recently from 9a18305 to 4f0e2f6 Compare September 15, 2017 16:24
@ejona86

ejona86 commented Sep 15, 2017

Copy link
Copy Markdown
Member Author

retest this please

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ejona86

ejona86 commented Sep 15, 2017

Copy link
Copy Markdown
Member Author

The dll isn't being loaded on Windows, and it's a PITA to figure out why because java.util.logging is broken in unit tests. I'll need to set up a full dev environment on Windows to figure out what's wrong.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@igorbernstein2 igorbernstein2 mentioned this pull request Sep 19, 2017
Consider publishing a shaded version of bigtable-client-core. googleapis/java-bigtable-hbase#1500
Closed
@ejona86 ejona86 added the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label Dec 8, 2017
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label Dec 8, 2017
@ejona86
Shade Netty transport, with tcnative
274cbc3
The entire transport is shaded because we wouldn't want to collide with
the unshaded form of grpc-netty.
@ejona86
ejona86 force-pushed the shade-netty branch from 4f0e2f6 to 274cbc3 Compare December 8, 2017 21:46
@ejona86

ejona86 commented Dec 8, 2017

Copy link
Copy Markdown
Member Author

Soo... I set up an environment, and then I rebased, and saw everything working. I'm assuming an update to Netty fixed the problem.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ejona86
ejona86 merged commit 83d710b into grpc:master Dec 8, 2017
@ejona86
ejona86 deleted the shade-netty branch December 8, 2017 22:02
@ejona86

ejona86 commented Dec 8, 2017

Copy link
Copy Markdown
Member Author

It was almost less than a year 😄

nevi-me reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@garrettjonesgoogle

garrettjonesgoogle commented Dec 8, 2017

Copy link
Copy Markdown
Contributor

lol that's an interesting way to characterize "more than a year" :-P

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ejona86 ejona86 added this to the 1.9 milestone Dec 8, 2017
@ejona86 ejona86 added the Type: Feature label Dec 8, 2017
@patriknw patriknw mentioned this pull request Feb 9, 2018
Use grpc-netty-shaded to avoid conflict with other Netty version akka/akka-grpc#1
Closed
@mastergberry

mastergberry commented Mar 16, 2018

Copy link
Copy Markdown

Hey @ejona86 we are trying to use GRPC 1.10 in our program and are having some netty conflictions. Wasn't this issue/change in 1.9 supposed to make it so GRPC used their own netty and didn't conflict with other libraries that used netty too?

https://github.com/grpc/grpc-java/blob/master/SECURITY.md#troubleshooting

We were going over this and wanted to know if it was completely up to date...because GRPC is using the wrong netty version when trying to write a response in our current application and this is causing issues.

augi reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ejona86

ejona86 commented Mar 19, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

@mastergberry, as mentioned in the in the v1.9.0 release notes and my proposed changes to SECURITY.md, you have to swap to grpc-netty-shaded to get the pre-shaded Netty. If you use grpc-netty then you will see the original behavior.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mastergberry

mastergberry commented Mar 19, 2018

Copy link
Copy Markdown

My apologies. Thanks for the nudge in the right direction.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lock lock Bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@zhangkun83 zhangkun83 zhangkun83 approved these changes
+1 more reviewer
@carl-mastrangelo carl-mastrangelo carl-mastrangelo approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

Type: Feature

Projects

None yet

Milestone

1.9

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

11 participants

@ejona86 @jhspaybar @nevi-me @zackangelo @garrettjonesgoogle @kuroneko25 @vkedia @mastergberry @carl-mastrangelo @zhangkun83 @kokoro-team
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.