NettyClientTransport: use getOrCreate() for new instances of ChannelLogger AttributeKey.#7048
Merged
creamsoup merged 10 commits intogrpc:masterfrom May 21, 2020
Merged
NettyClientTransport: use getOrCreate() for new instances of ChannelLogger AttributeKey.#7048creamsoup merged 10 commits intogrpc:masterfrom
creamsoup merged 10 commits intogrpc:masterfrom
Conversation
…hannelLogger` `AttributeKey`. `NettyClientTransport` throws an error when the class is loaded in two separate class-loaders because of some implementation detail with the underlying `AttributeKey` class. Instead of just blowing up when a new `ChannelLogger` key can't be created, this allows multiple, isolated class-loaders in the same JVM to just get the existing key. If this causes issues, this `AttributeKey` should be updated to use a new UUID (or something) each time it is loaded. Improvement: Works with isolated class-loaders. Potential Drawback: Uses the same `ChannelLogger` `AttributeKey` object across multiple, isolated classloaders.
Member
|
@Nexproc, please fix the checkstyle failures reported by Travis. |
Member
|
As I mention on #6707, it is probably better to delete this attribute. But I think it would be good to merge this mostly as-is for the v1.30 release and then do the nicer cleanup separately. |
reorder `final static` -> `static final`
Shortened the null check to get around coverage being upset about 1 line. This lets me avoid making this getOrCreate function public just to test whether AttributeKey works.
ejona86
approved these changes
May 21, 2020
creamsoup
approved these changes
May 21, 2020
creamsoup
approved these changes
May 21, 2020
Contributor
|
merged, thanks @Nexproc |
Contributor
Author
|
No problem! Thank you both, @creamsoup & @ejona86, for the quick turnaround! |
creamsoup
pushed a commit
to creamsoup/grpc-java
that referenced
this pull request
May 21, 2020
Member
|
Since I realized this does not impact netty+netty-shaded, this is no longer a release blocker. |
dfawley
pushed a commit
to dfawley/grpc-java
that referenced
this pull request
Jan 15, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

NettyClientTransportthrows an error when the class is loaded in two separate class-loaders because of some implementation detail with the underlyingAttributeKeyclass. Instead of just blowing up when a newChannelLoggerkey can't be created, this allows multiple, isolated class-loaders in the same JVM to just get the existing key. If this causes issues, thisAttributeKeyshould be updated to use a new UUID (or something) each time it is loaded.Improvement: Works with isolated class-loaders.
Potential Drawback: Uses the same
ChannelLoggerAttributeKeyobject across multiple, isolated classloaders.Fixes #6707