-
Notifications
You must be signed in to change notification settings - Fork 3.9k
NettyClientTransport: use getOrCreate() for new instances of ChannelLogger AttributeKey. #7048
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
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.
@Nexproc, please fix the checkstyle failures reported by Travis. |
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.
merged, thanks @Nexproc |
No problem! Thank you both, @creamsoup & @ejona86, for the quick turnaround! |
Since I realized this does not impact netty+netty-shaded, this is no longer a release blocker. |
NettyClientTransport
throws an error when the class is loaded in two separate class-loaders because of some implementation detail with the underlyingAttributeKey
class. Instead of just blowing up when a newChannelLogger
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, thisAttributeKey
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.Fixes #6707