Skip to content
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

接口级别注册时,泛化调用需要请求两次才能正常返回结果 #2591

Open
hookokoko opened this issue Jan 31, 2024 · 0 comments
Milestone

Comments

@hookokoko
Copy link

Environment

  • Server: Dubbo-go, branch release-3.1
  • Client: Dubbo-go, branch release-3.1
  • Protocol: Dubbo
  • Registry: zk

Issue description

使用release-3.1分支的dubbogo进行接口级别的泛化调用时,需要请求2次,才能返回正常结果。

参考dubbo-go-sample/generic/default中的例子:

如下,服务端dubbogo 指定registry-type: interface

  registries:
    zk:
      protocol: zookeeper
      timeout: 3s
      address: 127.0.0.1:2181
      registry-type: interface

当client进行如下调用时,第一次会提示Failed to invoke the method $invoke,第二次惨能正常返回结果

func callGetUser(refConf config.ReferenceConfig) {
	service := refConf.GetRPCService().(*generic.GenericService)
	resp, _ := service.Invoke(
		context.TODO(),
		"GetUser1",
		[]string{"java.lang.String"},
		[]hessian.Object{"A003"},
	)
	fmt.Println(resp)

	<-time.After(time.Second)
	resp, _ = service.Invoke(
		context.TODO(),
		"GetUser1",
		[]string{"java.lang.String"},
		[]hessian.Object{"A003"},
	)
	fmt.Println(resp)
}

结果如下,第一次调用报错,返回结果nil,第二次正常

2024-01-31 22:42:36     WARN    proxy/proxy.go:212      [CallProxy] received rpc err: Failed to invoke the method $invoke. No provider available for the service dubbo://:@:/?interface=org.apache.dubbo.samples.UserProvider&group=&version= from registry zookeeper://127.0.0.1:2181?registry=zookeeper&registry.group=&registry.label=true&registry.namespace=&registry.preferred=false&registry.role=0&registry.timeout=5s&registry.ttl=15m&registry.weight=0&registry.zone=&remote-client-name=dubbo.registries-zookeeper-127.0.0.1%3A2181&simplified=false on the consumer 192.168.199.108 using the dubbo version 3.1.1 .Please check if the providers have been started and registered.
<nil>

map[age:48 class:org.apache.dubbo.samples.User iD:A003 name:Joe time:2024-01-31 22:42:37.224 +0800 CST]

Logs

Click me to check logs
@chickenlj chickenlj added this to the 3.1.2 milestone Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants