You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "AlbumenJ (via GitHub)" <gi...@apache.org> on 2023/02/14 07:44:27 UTC

[GitHub] [dubbo] AlbumenJ commented on pull request #11517: Implement service-level payload

AlbumenJ commented on PR #11517:
URL: https://github.com/apache/dubbo/pull/11517#issuecomment-1429272760

   > ```java
   > /**
   >  * Get dubbo channel by netty channel through channel cache.
   >  * Put netty channel into it if dubbo channel don't exist in the cache.
   >  *
   >  * @param ch      netty channel
   >  * @param url
   >  * @param handler dubbo handler that contain netty's handler
   >  * @return
   >  */
   > static NettyChannel getOrAddChannel(Channel ch, URL url, ChannelHandler handler) {
   >     if (ch == null) {
   >         return null;
   >     }
   >     NettyChannel ret = CHANNEL_MAP.get(ch);
   >     if (ret == null) {
   >         NettyChannel nettyChannel = new NettyChannel(ch, url, handler);
   >         if (ch.isActive()) {
   >             nettyChannel.markActive(true);
   >             ret = CHANNEL_MAP.putIfAbsent(ch, nettyChannel);
   >         }
   >         if (ret == null) {
   >             ret = nettyChannel;
   >         }
   >     } else {
   >         ret.markActive(true);
   >     }
   >     return ret;
   > }
   > ```
   > 
   > @AlbumenJ NettyChannel seems to have a bug here. The key of CHANNEL_MAP is indeed the original channel of netty, and the url is not included, which means that when calling service2, the channel(created by first service) obtained contains the url of service1. The same goes for actual testing. Maybe we can solve it like this: the key of CHANNEL_MAP uses Channel+url instead of Channel
   
   We should prevent to get parameters from channel url. Channel should be shared among services.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org