-
-
Notifications
You must be signed in to change notification settings - Fork 16k
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
SimpleChannelPool "POOL_KEY" attribute name is easy to get conflict from user code #9542
Comments
@nizarm fancy to do a pr ? I think we may even use something like this: private final AttributeKey<SimpleChannelPool> poolKey = AttributeKey.newInstance("channelPool." +
System.identityHashCode(this)); Just in case there are multiple SimpleChannelPool instances. |
Yes - on it ! |
@nizarm ok cool... let me know if you get to busy and so can not finish it as I want to release the next version of netty mid next week and it would be nice to have this as well. |
…om user code. Avoid such conflicts by introducing a UUID in the name (netty#9542) Motivation: It is noticed that SimpleChannelPool's POOL_KEY attribute name channelPool is easy to get conflict with user code and throws an exception 'channelPool' is already in use. Being a generic framework - it would be great if we can name the attribute something unique - may be use UUID for the name since the name is not required later. Modifications: This change make sure that the POOL_KEY used inside SimpleChannelPool is unique by appending the object hashcode in the name. Result: No unwanted channel attribute name conflict with user code.
…om user code (#9542) (#9548) Motivation: It is noticed that SimpleChannelPool's POOL_KEY attribute name channelPool is easy to get conflict with user code and throws an exception 'channelPool' is already in use. Being a generic framework - it would be great if we can name the attribute something unique - may be use UUID for the name since the name is not required later. Modifications: This change make sure that the POOL_KEY used inside SimpleChannelPool is unique by appending the object hashcode in the name. Result: No unwanted channel attribute name conflict with user code.
Adapt to a change in Netty connection pool netty/netty#9542
Adapt to a change in Netty connection pool netty/netty#9542
Adapt to a change in Netty connection pool netty/netty#9542
HI @nizarm @normanmaurer , We are using Netty 4.1.42.Final, but we see the following exception twice in a month:
The related code is:
Since our code creates brand new SimpleChannelPool, Is it possible that that a SimpleChannelPool was garbage collected, then a new SimpleChannelPool is created at the same memory space and hit this already in use exception? |
I see that this change is rolled back with #9760 and the |
It is noticed that SimpleChannelPool's POOL_KEY attribute name "channelPool" is easy to get conflict with user code and throws an exception 'channelPool' is already in use. Being a generic framework - it would be great if we can name the attribute something unique - may be use UUID for the name since the name is not required later?
Create a channel attribute in user code with name 'channelPool' and when SimpleChannelPool is instantiated - 'channelPool' is already in use exception is thrown. This issue surfaced when we utilized Azure SDK.
Netty version:4.1.39
Suggested Fix: Use UUID to avoid user code conflict as shown below
The text was updated successfully, but these errors were encountered: