You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "nevin9939 (GitHub)" <gi...@apache.org> on 2019/04/01 11:29:35 UTC

[GitHub] [incubator-dubbo] nevin9939 opened issue #3785: dubbo-2.7.1 providers 重复注册

服务第一次正常启动后,可以在zookeeper中的对应接口的providers下看到正常注册的服务,但是当Tomcat停止后,改providers下的服务仍然存在,Tomcat重新启动后,providers下相同的服务又注册了一遍,结果providers下存在了两个服务,一个是本次Tomcat启动后注册进去的,一个是上次Tomcat启动注册进去的,没有销毁,两个服务的区别主要是pid和timestamp不一样,因服务端的配置使用-1随机端口,偶尔两个服务的port也不一样;结果providers下的两个服务一个可以被客户端调用,一个不能,造成客户端偶发调不通服务的现象。
不知道为什么在Tomcat停止后,zookeeper中接口providers下,失效的服务为什么没有销毁

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3785 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] carryxyh commented on issue #3785: dubbo-2.7.1 providers 重复注册

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
@beiwei30 Thx for your reply.

@cvictory  Seems like `true` will be better for default value ? Since we should keep `Config` class same with `Annotation`. But `Annotation` can't make default value `null`.

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3785 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] nevin9939 commented on issue #3785: dubbo-2.7.1 providers 重复注册

Posted by "nevin9939 (GitHub)" <gi...@apache.org>.
@kingcode100  我把源代码修改了,然后重新打包本地用

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3785 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] cvictory commented on issue #3785: dubbo-2.7.1 providers 重复注册

Posted by "cvictory (GitHub)" <gi...@apache.org>.
I think the default value of dynamic should be null in AbstractServiceConfig

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3785 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] beiwei30 commented on issue #3785: dubbo-2.7.1 providers 重复注册

Posted by "beiwei30 (GitHub)" <gi...@apache.org>.
The original change made for fixing issue #195: @Reference check=false不生效 (#3530). For some particular boolean flags, it should have the default value in order to align with the default value from the annotation. 

In this case, the original value is null and the annotation default value is false. I double checked how this value is used, and figured out its default value should be 'true', or roll back to null.

@carryxyh would you mind to give it a try to change it to

```java
protected Boolean dynamic = true;
```

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3785 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] carryxyh commented on issue #3785: dubbo-2.7.1 providers 重复注册

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
Hi, @cvictory 
Seems like we should make `dynamic` default true to make the info delete from zk when provider/consumer shutdown.

But I am not sure about why the default value changed to `false` at beiwei's pr...

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3785 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] nevin9939 commented on issue #3785: dubbo-2.7.1 providers 重复注册

Posted by "nevin9939 (GitHub)" <gi...@apache.org>.
原因找到了
org.apache.dubbo.config.AbstractServiceConfig#dynamic
原来的默认值是null
现在调整成默认false了,不知道这样调整的好处是什么,至少在我的这个场景产生了BUG

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3785 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] kingcode100 commented on issue #3785: dubbo-2.7.1 providers 重复注册

Posted by "kingcode100 (GitHub)" <gi...@apache.org>.
我也出现了相同的BUG ,于是我尝试配置dynamic=true,用下面3种方式各试了一遍。发现不会生效,只能注册静态服务了
dubbo.service.dynamic=true
dubbo.registry.dynamic=true
dubbo.protocol.dynamic=true

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3785 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] nevin9939 commented on issue #3785: dubbo-2.7.1 providers 重复注册

Posted by "nevin9939 (GitHub)" <gi...@apache.org>.
<img width="825" alt="tttttttttttt" src="https://user-images.githubusercontent.com/26532831/55324478-ceb00780-54b4-11e9-8fea-4920643ff57c.png">


[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3785 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] carryxyh commented on issue #3785: dubbo-2.7.1 providers 重复注册

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
Hi, thanks for your issue.
I'd like take a look.

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3785 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] carryxyh commented on issue #3785: dubbo-2.7.1 providers 重复注册

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
Sent an email and wait for beiwei's reply.

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3785 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] beiwei30 commented on issue #3785: dubbo-2.7.1 providers 重复注册

Posted by "beiwei30 (GitHub)" <gi...@apache.org>.
The original change made for fixing issue #195: @Reference check=false不生效 (#3530). For some particular boolean flags, it should have the default value in order to align with the default value from the annotation. 

In this case, the original value is null and the annotation default value is false. I double checked how this value is used, and figured out its default value should be 'true', or roll back to null.

@carryxyh would you mind to give it a try to change it to

```java
protected Boolean dynamic = true;
```

pls. keep in mind you also need to change the default value from the annotation:

```java
boolean dynamic() default true;
```

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3785 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] carryxyh closed issue #3785: dubbo-2.7.1 providers 重复注册

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
[ issue closed by carryxyh ]

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3785 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] kingcode100 commented on issue #3785: dubbo-2.7.1 providers 重复注册

Posted by "kingcode100 (GitHub)" <gi...@apache.org>.
> 服务第一次正常启动后,可以在zookeeper中的对应接口的providers下看到正常注册的服务,但是当Tomcat停止后,改providers下的服务仍然存在,Tomcat重新启动后,providers下相同的服务又注册了一遍,结果providers下存在了两个服务,一个是本次Tomcat启动后注册进去的,一个是上次Tomcat启动注册进去的,没有销毁,两个服务的区别主要是pid和timestamp不一样,因服务端的配置使用-1随机端口,偶尔两个服务的port也不一样;结果providers下的两个服务一个可以被客户端调用,一个不能,造成客户端偶发调不通服务的现象。
> 不知道为什么在Tomcat停止后,zookeeper中接口providers下,失效的服务为什么没有销毁
> <img alt="tttttttttttt" width="825" src="https://user-images.githubusercontent.com/26532831/55324549-05861d80-54b5-11e9-8021-6cf64350633d.png">

请教一下,目前是怎么解决这个问题的。

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3785 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] carryxyh commented on issue #3785: dubbo-2.7.1 providers 重复注册

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
Hi, @cvictory 
Seems like we should make `dynamic` default `true` to make the info delete from zk when provider/consumer shutdown.

But I am not sure about why the default value changed to `false` at beiwei's pr...

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3785 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] cvictory commented on issue #3785: dubbo-2.7.1 providers 重复注册

Posted by "cvictory (GitHub)" <gi...@apache.org>.
@carryxyh @nevin9939  Do you fix this issue? Or can you commit a pr?

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3785 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org