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

netty: Support pseudo headers in all GrpcHttp2RequestHeaders methods #9004

Merged
merged 5 commits into from Mar 22, 2022

Conversation

ejona86
Copy link
Member

@ejona86 ejona86 commented Mar 21, 2022

The previous code assumed that only gRPC would be using these methods.
But twice now Netty has made a change (generally relating to security)
that used a method for pseudo headers that previously wasn't supported.
Let's stop the whack-a-mole and just implement them all.

This restores compatibility with Netty 4.1.75.Final. Fixes #8981

CC @njhill
Alternative to #9001

The previous code assumed that only gRPC would be using these methods.
But twice now Netty has made a change (generally relating to security)
that used a method for pseudo headers that previously wasn't supported.
Let's stop the whack-a-mole and just implement them all.

This restores compatibility with Netty 4.1.75.Final. Fixes grpc#8981
@ejona86 ejona86 requested a review from sergiitk March 21, 2022 22:13
@@ -340,7 +340,12 @@ public Http2Headers add(CharSequence csName, CharSequence csValue) {
AsciiString name = validateName(requireAsciiString(csName));
AsciiString value = requireAsciiString(csValue);
if (isPseudoHeader(name)) {
addPseudoHeader(name, value);
AsciiString previous = getPseudoHeader(name);
Copy link
Member Author

Choose a reason for hiding this comment

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

It'd be possible to implement this without a get-then-set if setPseudoHeader() returned the old value. We'd have to re-set the old value if there was one already present, but that's not the worst. Returning-old-valuesetPseudoHeader() would seem to most benefit remove(), but it isn't safe for remove because it would throw for remove(":status'). Having the returning-old-value setPseudoHeader() made it really easy to make mistakes, so I went with the KISS approach. These code paths don't matter for performance.

I had these changes locally, but failed to use "-a" for my "git commit"
to add them...
@ejona86 ejona86 merged commit 4a0fe99 into grpc:master Mar 22, 2022
@ejona86 ejona86 deleted the netty-more-header-methods branch March 22, 2022 14:39
lhotari added a commit to lhotari/pulsar that referenced this pull request Apr 19, 2022
- grpc < 1.45.1 is not compatible with Netty > 4.1.74.Final
  - grpc/grpc-java#9004
lhotari added a commit to lhotari/pulsar that referenced this pull request Apr 19, 2022
- grpc < 1.45.1 is not compatible with Netty > 4.1.74.Final
  - grpc/grpc-java#9004
lhotari added a commit to lhotari/pulsar that referenced this pull request Apr 19, 2022
- grpc < 1.45.1 is not compatible with Netty > 4.1.74.Final
  - grpc/grpc-java#9004
lhotari added a commit to apache/pulsar that referenced this pull request Apr 19, 2022
)

* Upgrade Netty to 4.1.76.Final and Netty Tcnative to 2.0.51.Final

Fixes #14015
- release notes https://netty.io/news/2022/04/12/4-1-76-Final.html
  - contains fix for netty/netty#11695

* Upgrade grpc to 1.45.1 and protobuf to 3.19.2

- grpc < 1.45.1 is not compatible with Netty > 4.1.74.Final
  - grpc/grpc-java#9004
Nicklee007 pushed a commit to Nicklee007/pulsar that referenced this pull request Apr 20, 2022
…che#15212)

* Upgrade Netty to 4.1.76.Final and Netty Tcnative to 2.0.51.Final

Fixes apache#14015
- release notes https://netty.io/news/2022/04/12/4-1-76-Final.html
  - contains fix for netty/netty#11695

* Upgrade grpc to 1.45.1 and protobuf to 3.19.2

- grpc < 1.45.1 is not compatible with Netty > 4.1.74.Final
  - grpc/grpc-java#9004
lhotari added a commit to datastax/pulsar that referenced this pull request Apr 20, 2022
…che#15212)

* Upgrade Netty to 4.1.76.Final and Netty Tcnative to 2.0.51.Final

Fixes apache#14015
- release notes https://netty.io/news/2022/04/12/4-1-76-Final.html
  - contains fix for netty/netty#11695

* Upgrade grpc to 1.45.1 and protobuf to 3.19.2

- grpc < 1.45.1 is not compatible with Netty > 4.1.74.Final
  - grpc/grpc-java#9004

(cherry picked from commit 332a3c7)
gaoran10 pushed a commit to apache/pulsar that referenced this pull request Apr 21, 2022
)

* Upgrade Netty to 4.1.76.Final and Netty Tcnative to 2.0.51.Final

Fixes #14015
- release notes https://netty.io/news/2022/04/12/4-1-76-Final.html
  - contains fix for netty/netty#11695

* Upgrade grpc to 1.45.1 and protobuf to 3.19.2

- grpc < 1.45.1 is not compatible with Netty > 4.1.74.Final
  - grpc/grpc-java#9004

(cherry picked from commit 332a3c7)
gaoran10 pushed a commit to apache/pulsar that referenced this pull request Apr 21, 2022
)

* Upgrade Netty to 4.1.76.Final and Netty Tcnative to 2.0.51.Final

Fixes #14015
- release notes https://netty.io/news/2022/04/12/4-1-76-Final.html
  - contains fix for netty/netty#11695

* Upgrade grpc to 1.45.1 and protobuf to 3.19.2

- grpc < 1.45.1 is not compatible with Netty > 4.1.74.Final
  - grpc/grpc-java#9004

(cherry picked from commit 332a3c7)
lhotari added a commit to datastax/pulsar that referenced this pull request Apr 22, 2022
…che#15212)

* Upgrade Netty to 4.1.76.Final and Netty Tcnative to 2.0.51.Final

Fixes apache#14015
- release notes https://netty.io/news/2022/04/12/4-1-76-Final.html
  - contains fix for netty/netty#11695

* Upgrade grpc to 1.45.1 and protobuf to 3.19.2

- grpc < 1.45.1 is not compatible with Netty > 4.1.74.Final
  - grpc/grpc-java#9004

(cherry picked from commit 332a3c7)
lhotari added a commit to datastax/pulsar that referenced this pull request Apr 22, 2022
…che#15212)

* Upgrade Netty to 4.1.76.Final and Netty Tcnative to 2.0.51.Final

Fixes apache#14015
- release notes https://netty.io/news/2022/04/12/4-1-76-Final.html
  - contains fix for netty/netty#11695

* Upgrade grpc to 1.45.1 and protobuf to 3.19.2

- grpc < 1.45.1 is not compatible with Netty > 4.1.74.Final
  - grpc/grpc-java#9004

(cherry picked from commit 332a3c7)
codelipenghui pushed a commit to apache/pulsar that referenced this pull request Apr 28, 2022
)

* Upgrade Netty to 4.1.76.Final and Netty Tcnative to 2.0.51.Final

Fixes #14015
- release notes https://netty.io/news/2022/04/12/4-1-76-Final.html
  - contains fix for netty/netty#11695

* Upgrade grpc to 1.45.1 and protobuf to 3.19.2

- grpc < 1.45.1 is not compatible with Netty > 4.1.74.Final
  - grpc/grpc-java#9004

(cherry picked from commit 332a3c7)
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Apr 28, 2022
…che#15212)

* Upgrade Netty to 4.1.76.Final and Netty Tcnative to 2.0.51.Final

Fixes apache#14015
- release notes https://netty.io/news/2022/04/12/4-1-76-Final.html
  - contains fix for netty/netty#11695

* Upgrade grpc to 1.45.1 and protobuf to 3.19.2

- grpc < 1.45.1 is not compatible with Netty > 4.1.74.Final
  - grpc/grpc-java#9004

(cherry picked from commit 332a3c7)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Netty 4.1.75.Final HTTP/2 connection closures
3 participants