You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/09/12 06:33:29 UTC

[GitHub] [dubbo] frlzk opened a new issue #8777: 接口多分组实现情况下,分组聚合结果不正确.

frlzk opened a new issue #8777:
URL: https://github.com/apache/dubbo/issues/8777


   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   - [ ] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.
   
   ### Environment
   
   * Dubbo version: 3.0.2.1
   * Operating System version: Ubuntu20
   * Java version: 1.8
   * nacos 2.0
   
   ### Steps to reproduce this issue
   
   一个接口4个实现,其中两个实现在consumer端,另两个在provider端。这4个实现属于不同的group
   `
   //接口定义
   public class Hello implements Serializable {
   	private String name;
   	public String getName() {
   		return name;
   	}
   	public void setName(String name) {
   		this.name = name;
   	}
   }
   public interface HelloService {
   	public List<Hello> hellos();
   }
   //使用接口的Controller
   @Controller
   public class HelloController {
   	@DubboReference(group="*",merger="list" ) //scope="remote",
   	HelloService service;
   	
   	@RequestMapping("/hellos")
   	@ResponseBody
   	public List<Hello> hellos() {
   		return service.hellos();
   	}
   }
   //消费端接口实现
   @DubboService(group="consumerHello1")
   public class Hello1ServiceImpl implements HelloService {
   	public List<Hello> hellos(){
   		List<Hello> res=new ArrayList();
   		Hello hell=new Hello();
   		hell.setName("consumer-hello-1");
   		res.add(hell);
   		return res;
   	}
   }
   @DubboService(group="consumerHello2")
   public class Hello2ServiceImpl implements HelloService {
   	public List<Hello> hellos(){
   		List<Hello> res=new ArrayList();
   		Hello hell=new Hello();
   		hell.setName("consumer-hello-2");
   		res.add(hell);
   		return res;
   	}
   }
   
   //服务端接口实现
   @DubboService(group="providerHello1")
   public class Hello1ServiceImpl implements HelloService {
   
   	public List<Hello> hellos(){
   		List<Hello> res=new ArrayList();
   		Hello hell=new Hello();
   		hell.setName("provider-hello-1");
   		res.add(hell);
   		return res;
   	}
   }
   @DubboService(group="providerHello2")
   public class Hello2ServiceImpl implements HelloService {
   	public List<Hello> hellos(){
   		List<Hello> res=new ArrayList();
   		Hello hell=new Hello();
   		hell.setName("provider-hello-2");
   		res.add(hell);
   		return res;
   	}
   }
   
   `
   
   ###运行结果和期望结果共7种情况,其中只有一个符合预期:
   1. 不设置scope参数:@DubboReference(group="*",merger="list")
   1.1 只启动consumer,调用HelloController
   	结果:返回一条数据
   	期望:返回两条数据
   1.2 先启动consumer,再启动provider,调用HelloController
   	结果:返回一条数据
   	期望:返回四条数据
   1.3 先启动provider,再启动consumer,调用HelloController
   	结果:返回一条数据
   	期望:返回四条数据
   2. 设置scope参数:@DubboReference(group="*",merger="list",scope="remote")
   2.1 只启动consumer,调用HelloController
   	结果:返回一条数据
   	期望:返回两条数据
   2.2	先启动consumer,再启动provider,调用HelloController
   	结果:返回一条数据
   	期望:返回四条数据
   2.3 先启动provider,再启动consumer,调用HelloController
   	结果:返回四条数据
   	期望:返回四条数据
   2.3 先启动provider,再启动consumer,调用HelloController,关闭provider,再次调用HelloController
   	结果:org.apache.dubbo.rpc.RpcException: No provider available from registry 127.0.0.1:8848
   	期望:返回两条数据
   	


-- 
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


[GitHub] [dubbo] CrazyHZM commented on issue #8777: 接口多分组实现情况下,分组聚合结果不正确.

Posted by GitBox <gi...@apache.org>.
CrazyHZM commented on issue #8777:
URL: https://github.com/apache/dubbo/issues/8777#issuecomment-986165042


   @brotherlu-xcq 
   Any progress ?


-- 
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


[GitHub] [dubbo] CrazyHZM commented on issue #8777: 接口多分组实现情况下,分组聚合结果不正确.

Posted by GitBox <gi...@apache.org>.
CrazyHZM commented on issue #8777:
URL: https://github.com/apache/dubbo/issues/8777#issuecomment-951548224


   > @CrazyHZM Hi, Bro. I try to find the root cause. find that the same service in different group only generate one invoker, so that always return one data. I am not sure if the framework changed in dubbo 3.0 cause this issue. could you give me some guide on this issue?
   
   Only hold the MergeableClusterInvoker object, but there will be multiple node selections, which can be reviewed to affect whether the MergeableClusterInvoker meets expectations


-- 
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


[GitHub] [dubbo] ycoe commented on issue #8777: 接口多分组实现情况下,分组聚合结果不正确.

Posted by GitBox <gi...@apache.org>.
ycoe commented on issue #8777:
URL: https://github.com/apache/dubbo/issues/8777#issuecomment-1010953695


   我也遇到类似的问题,这是我的debug结果:
   1. 在订阅阶段 org.apache.dubbo.registry.nacos.NacosRegistry#doSubscribe(org.apache.dubbo.common.URL, org.apache.dubbo.registry.NotifyListener, java.util.Set<java.lang.String>) 方法拿到了两个provider。然后循环处理
   ![image](https://user-images.githubusercontent.com/985424/149131549-e1ee4eed-22f6-41d3-a41d-a316d7c71e05.png)
   
   2. 在org.apache.dubbo.rpc.cluster.directory.AbstractDirectory#setInvokers,将invokers设置进去在第二次进入此方法时,原来的this.invokers已经有一个值,但执行完后会直接覆盖,导致了后面执行时,invokers永远只有一个值。
   ![image](https://user-images.githubusercontent.com/985424/149132169-2adbb3b8-09c2-4a2d-9c58-209f0d138534.png)
   
   我查了下2.6.x版本的,注册流程不是这样的,应该是重构后的代码
   
   


-- 
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


[GitHub] [dubbo] ycoe removed a comment on issue #8777: 接口多分组实现情况下,分组聚合结果不正确.

Posted by GitBox <gi...@apache.org>.
ycoe removed a comment on issue #8777:
URL: https://github.com/apache/dubbo/issues/8777#issuecomment-1010953695


   我也遇到类似的问题,这是我的debug结果:
   1. 在订阅阶段 org.apache.dubbo.registry.nacos.NacosRegistry#doSubscribe(org.apache.dubbo.common.URL, org.apache.dubbo.registry.NotifyListener, java.util.Set<java.lang.String>) 方法拿到了两个provider。然后循环处理
   ![image](https://user-images.githubusercontent.com/985424/149131549-e1ee4eed-22f6-41d3-a41d-a316d7c71e05.png)
   
   2. 在org.apache.dubbo.rpc.cluster.directory.AbstractDirectory#setInvokers,将invokers设置进去在第二次进入此方法时,原来的this.invokers已经有一个值,但执行完后会直接覆盖,导致了后面执行时,invokers永远只有一个值。
   ![image](https://user-images.githubusercontent.com/985424/149132169-2adbb3b8-09c2-4a2d-9c58-209f0d138534.png)
   
   我查了下2.6.x版本的,注册流程不是这样的,应该是重构后的代码
   
   提了个PR: https://github.com/apache/dubbo/pull/9565/files


-- 
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


[GitHub] [dubbo] brotherlu-xcq commented on issue #8777: 接口多分组实现情况下,分组聚合结果不正确.

Posted by GitBox <gi...@apache.org>.
brotherlu-xcq commented on issue #8777:
URL: https://github.com/apache/dubbo/issues/8777#issuecomment-951508958


   @CrazyHZM Hi, Bro. I try to find the root cause. find that the same service in different group only generate one invoker, so that always return one data. I am not sure if the framework changed in dubbo 3.0 cause this issue. could you give me some guide on this issue?


-- 
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


[GitHub] [dubbo] CrazyHZM commented on issue #8777: 接口多分组实现情况下,分组聚合结果不正确.

Posted by GitBox <gi...@apache.org>.
CrazyHZM commented on issue #8777:
URL: https://github.com/apache/dubbo/issues/8777#issuecomment-1025404251


   For the above scenarios that do not meet expectations
   There are two main reasons: 
   1. Local references do not support grouping and aggregation capabilities
   2. Local and remote are currently one of the alternatives, and the priority of Local is higher than that of remote
   First to support the first ability, the second involves relatively large reconstruction, slow down first


-- 
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


[GitHub] [dubbo] ycoe edited a comment on issue #8777: 接口多分组实现情况下,分组聚合结果不正确.

Posted by GitBox <gi...@apache.org>.
ycoe edited a comment on issue #8777:
URL: https://github.com/apache/dubbo/issues/8777#issuecomment-1010953695


   我也遇到类似的问题,这是我的debug结果:
   1. 在订阅阶段 org.apache.dubbo.registry.nacos.NacosRegistry#doSubscribe(org.apache.dubbo.common.URL, org.apache.dubbo.registry.NotifyListener, java.util.Set<java.lang.String>) 方法拿到了两个provider。然后循环处理
   ![image](https://user-images.githubusercontent.com/985424/149131549-e1ee4eed-22f6-41d3-a41d-a316d7c71e05.png)
   
   2. 在org.apache.dubbo.rpc.cluster.directory.AbstractDirectory#setInvokers,将invokers设置进去在第二次进入此方法时,原来的this.invokers已经有一个值,但执行完后会直接覆盖,导致了后面执行时,invokers永远只有一个值。
   ![image](https://user-images.githubusercontent.com/985424/149132169-2adbb3b8-09c2-4a2d-9c58-209f0d138534.png)
   
   我查了下2.6.x版本的,注册流程不是这样的,应该是重构后的代码
   
   提了个PR: https://github.com/apache/dubbo/pull/9565/files


-- 
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