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/11/05 05:28:03 UTC

[GitHub] [dubbo] zrlw opened a new issue #9210: [3.0] AbstractDirectory访问invokers,validInvokers对象时未判NULL可导致NPE

zrlw opened a new issue #9210:
URL: https://github.com/apache/dubbo/issues/9210


   ### Environment
   
   * Dubbo version: 3.0
   NPE如下所示
   https://github.com/apache/dubbo/runs/4113012092?check_suite_focus=true
   ```
   2021-11-05T03:07:48.1927405Z [INFO] java.lang.NullPointerException
   2021-11-05T03:07:48.1933640Z [INFO] 	at org.apache.dubbo.rpc.cluster.RouterChain.route(RouterChain.java:174)
   2021-11-05T03:07:48.1936223Z [INFO] 	at org.apache.dubbo.registry.integration.DynamicDirectory.doList(DynamicDirectory.java:183)
   2021-11-05T03:07:48.1944252Z [INFO] 	at org.apache.dubbo.rpc.cluster.directory.AbstractDirectory.list(AbstractDirectory.java:186)
   2021-11-05T03:07:48.1949775Z [INFO] 	at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.list(AbstractClusterInvoker.java:392)
   2021-11-05T03:07:48.2016991Z [INFO] 	at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:329)
   2021-11-05T03:07:48.2019606Z [INFO] 	at org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:92)
   2021-11-05T03:07:48.2022000Z [INFO] 	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:84)
   2021-11-05T03:07:48.2024621Z [INFO] 	at org.apache.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:51)
   2021-11-05T03:07:48.2027274Z [INFO] 	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:84)
   2021-11-05T03:07:48.2030322Z [INFO] 	at org.apache.dubbo.rpc.cluster.filter.support.ConsumerContextFilter.invoke(ConsumerContextFilter.java:108)
   2021-11-05T03:07:48.2033091Z [INFO] 	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$FilterChainNode.invoke(FilterChainBuilder.java:84)
   2021-11-05T03:07:48.2036348Z [INFO] 	at org.apache.dubbo.rpc.cluster.support.wrapper.AbstractCluster$ClusterFilterInvoker.invoke(AbstractCluster.java:92)
   2021-11-05T03:07:48.2039691Z [INFO] 	at org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:95)
   2021-11-05T03:07:48.2043182Z [INFO] 	at org.apache.dubbo.registry.client.migration.MigrationInvoker.invoke(MigrationInvoker.java:276)
   2021-11-05T03:07:48.2046470Z [INFO] 	at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:92)
   2021-11-05T03:07:48.2048634Z [INFO] 	at org.apache.dubbo.common.bytecode.proxy5.hello(proxy5.java)
   2021-11-05T03:07:48.2051148Z [INFO] 	at org.apache.dubbo.config.bootstrap.MultiInstanceTest.testAsyncExportAndReferServices(MultiInstanceTest.java:849)
   ```
   
   此外,上面异常日志信息暴露出MultiInstanceTest存在的问题: provider启动完成并不意味着完成注册,此时客户端直接调用会因无注册信息而失败。


-- 
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] zrlw edited a comment on issue #9210: [3.0] AbstractDirectory存在NPE以及任务future覆盖问题

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


   其次还有this.connectivityCheckFuture被创建的新任务覆盖的问题:
   checkConnectivity异步创建的任务在结束前判断是否有新task,如果有就再次调用checkConnectivity:
   1. this.connectivityCheckFuture在checkConnectivity方法返回调用者之后又被更新,调用者并不知情;
   2. 调用者在老connectivityCheckFuture上等待的后果就是新task未执行完,调用者继续执行后面的代码会出问题,比如:
   https://github.com/apache/dubbo/runs/4130565263?check_suite_focus=true
   ```
   2021-11-07T11:46:56.1815610Z [ERROR] Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.19 s <<< FAILURE! - in org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest
   2021-11-07T11:46:56.1818867Z [ERROR] org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest.testRetry  Time elapsed: 0.007 s  <<< FAILURE!
   2021-11-07T11:46:56.1820680Z org.opentest4j.AssertionFailedError: expected: <2> but was: <1>
   2021-11-07T11:46:56.1822662Z 	at org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest.testRetry(ConnectivityValidationTest.java:190)
   ```


-- 
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] zrlw edited a comment on issue #9210: [3.0] AbstractDirectory存在NPE以及connectivityCheckFuture重新赋值的问题

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


   再说一下this.connectivityCheckFuture被创建的新任务重新赋值的问题:
   checkConnectivity异步创建的任务在结束前判断是否有新task,如果有就再次调用checkConnectivity:
   1. this.connectivityCheckFuture在checkConnectivity方法返回调用者之后又被赋了新值,但调用者并不知情;
   2. 调用者在旧的connectivityCheckFuture上等待的结果就是新task未执行完,调用者就继续执行后面的代码,然后出问题,比如:
   https://github.com/apache/dubbo/runs/4130565263?check_suite_focus=true
   ```
   2021-11-07T11:46:56.1815610Z [ERROR] Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.19 s <<< FAILURE! - in org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest
   2021-11-07T11:46:56.1818867Z [ERROR] org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest.testRetry  Time elapsed: 0.007 s  <<< FAILURE!
   2021-11-07T11:46:56.1820680Z org.opentest4j.AssertionFailedError: expected: <2> but was: <1>
   2021-11-07T11:46:56.1822662Z 	at org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest.testRetry(ConnectivityValidationTest.java:190)
   ```
   更新:
   还不能简单地在checkConnectivity创建的task里面等待新任务结束,那样就违背了checkConnectivity的设计初衷,为了避免长时间占用connectivityExecutor,checkConnectivity采用的是分批处理的策略,所以PR #9211 最终这么改了:
   1. 将checkConnectivity创建的任务变成返回future的Callable类型,如果在任务结束前创建了新任务,则返回新任务的future,否则返回当前future,以让调用者知情。
   2. ConnectivityValidationTest的waitRefresh方法的结束条件改为invokersToReconnect列表里没有需要recover的invoker。


-- 
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] zrlw edited a comment on issue #9210: [3.0] AbstractDirectory存在NPE以及connectivityCheckFuture重新赋值的问题

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


   再说一下this.connectivityCheckFuture被创建的新任务重新赋值的问题:
   checkConnectivity异步创建的任务在结束前判断是否有新task,如果有就再次调用checkConnectivity:
   1. this.connectivityCheckFuture在checkConnectivity方法返回调用者之后又被赋了新值,但调用者并不知情;
   2. 调用者在旧的connectivityCheckFuture上等待的结果就是新task未执行完,调用者就继续执行后面的代码,然后出问题,比如:
   https://github.com/apache/dubbo/runs/4130565263?check_suite_focus=true
   ```
   2021-11-07T11:46:56.1815610Z [ERROR] Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.19 s <<< FAILURE! - in org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest
   2021-11-07T11:46:56.1818867Z [ERROR] org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest.testRetry  Time elapsed: 0.007 s  <<< FAILURE!
   2021-11-07T11:46:56.1820680Z org.opentest4j.AssertionFailedError: expected: <2> but was: <1>
   2021-11-07T11:46:56.1822662Z 	at org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest.testRetry(ConnectivityValidationTest.java:190)
   ```
   更新:
   还不能简单地在checkConnectivity创建的task里面等待新任务结束,那样就违背了checkConnectivity的设计初衷,为了避免长时间占用connectivityExecutor,checkConnectivity采用的是分批处理的策略,所以PR #9211 最终没有修改connectivityExecutor,而是修改了ConnectivityValidationTest的waitRefresh方法,将等待条件改为invokersToReconnect列表里没有需要进行recover的invoker。


-- 
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] zrlw commented on issue #9210: [3.0] AbstractDirectory访问invokers,validInvokers对象时未判NULL可导致NPE

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


   派生类和AbstractDirectory一起对AbstractDirectory的成员invokers,validInvokers进行操作违反了开闭原则,代码散落在各个类里面也不利于维护。


-- 
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] zrlw edited a comment on issue #9210: [3.0] AbstractDirectory存在NPE以及connectivityCheckFuture重新赋值的问题

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


   再说一下this.connectivityCheckFuture被创建的新任务重新赋值的问题:
   checkConnectivity异步创建的任务在结束前判断是否有新task,如果有就再次调用checkConnectivity:
   1. this.connectivityCheckFuture在checkConnectivity方法返回调用者之后又被赋了新值,但调用者并不知情;
   2. 调用者在旧的connectivityCheckFuture上等待的结果就是新task未执行完,调用者就继续执行后面的代码,然后出问题,比如:
   https://github.com/apache/dubbo/runs/4130565263?check_suite_focus=true
   ```
   2021-11-07T11:46:56.1815610Z [ERROR] Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.19 s <<< FAILURE! - in org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest
   2021-11-07T11:46:56.1818867Z [ERROR] org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest.testRetry  Time elapsed: 0.007 s  <<< FAILURE!
   2021-11-07T11:46:56.1820680Z org.opentest4j.AssertionFailedError: expected: <2> but was: <1>
   2021-11-07T11:46:56.1822662Z 	at org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest.testRetry(ConnectivityValidationTest.java:190)
   ```
   更新:
   还不能简单地在checkConnectivity创建的task里面等待新任务结束,那样就违背了checkConnectivity的设计初衷,为了避免长时间占用connectivityExecutor,checkConnectivity采用的是分批处理的策略,所以PR #9211 最终这么改了:
   1. 将checkConnectivity创建的任务变成返回future的Callable类型,如果在任务结束前创建新任务,则返回新任务future,否则返回当前future,调用者可以通过future.get()获取新任务future。
   2. ConnectivityValidationTest的waitRefresh方法的结束条件改为invokersToReconnect列表里没有需要recover的invoker。


-- 
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] zrlw commented on issue #9210: [3.0] AbstractDirectory访问invokers,validInvokers对象时未判NULL可导致NPE

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


   派生类和AbstractDirectory一起对AbstractDirectory的成员invokers,validInvokers进行操作违反了开闭原则,代码散落在各个类里面也不利于维护。


-- 
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] zrlw commented on issue #9210: [3.0] AbstractDirectory访问invokers,validInvokers对象时未判NULL可导致NPE

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


   还有一个问题:
   checkConnectivity异步创建的任务在结束前判断是否有新task,如果有就再次调用checkConnectivity:
   1. this.connectivityCheckFuture在checkConnectivity方法返回调用者之后又被更新,调用者并不知情;
   2. 调用者在老connectivityCheckFuture上等待的后果就是新task未执行完,调用者继续执行后面的代码会出问题,比如:
   https://github.com/apache/dubbo/runs/4130565263?check_suite_focus=true
   ```
   2021-11-07T11:46:56.1815610Z [ERROR] Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.19 s <<< FAILURE! - in org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest
   2021-11-07T11:46:56.1818867Z [ERROR] org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest.testRetry  Time elapsed: 0.007 s  <<< FAILURE!
   2021-11-07T11:46:56.1820680Z org.opentest4j.AssertionFailedError: expected: <2> but was: <1>
   2021-11-07T11:46:56.1822662Z 	at org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest.testRetry(ConnectivityValidationTest.java:190)
   ```


-- 
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] zrlw edited a comment on issue #9210: [3.0] AbstractDirectory存在NPE以及connectivityCheckFuture重新赋值的问题

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


   再说一下this.connectivityCheckFuture被创建的新任务重新赋值的问题:
   checkConnectivity异步创建的任务在结束前判断是否有新task,如果有就再次调用checkConnectivity:
   1. this.connectivityCheckFuture在checkConnectivity方法返回调用者之后又被赋了新值,但调用者并不知情;
   2. 调用者在旧的connectivityCheckFuture上等待的结果就是新task未执行完,调用者就继续执行后面的代码,然后出问题,比如:
   https://github.com/apache/dubbo/runs/4130565263?check_suite_focus=true
   ```
   2021-11-07T11:46:56.1815610Z [ERROR] Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.19 s <<< FAILURE! - in org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest
   2021-11-07T11:46:56.1818867Z [ERROR] org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest.testRetry  Time elapsed: 0.007 s  <<< FAILURE!
   2021-11-07T11:46:56.1820680Z org.opentest4j.AssertionFailedError: expected: <2> but was: <1>
   2021-11-07T11:46:56.1822662Z 	at org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest.testRetry(ConnectivityValidationTest.java:190)
   ```
   更新:
   还不能简单地在checkConnectivity创建的task里面等待新任务结束,那样就违背了checkConnectivity的设计初衷,为了避免长时间占用connectivityExecutor,checkConnectivity采用的是分批处理的策略,所以PR9211最终这么做了:
   1. 将checkConnectivity创建的任务变成返回future的Callable类型,如果在任务结束前创建了新任务,则返回新任务的future,否则返回当前future,以便让调用者知情。
   2. ConnectivityValidationTest的waitRefresh方法的结束条件改为invokersToReconnect列表里没有需要recover的invoker。


-- 
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] zrlw edited a comment on issue #9210: [3.0] AbstractDirectory存在NPE以及connectivityCheckFuture重新赋值的问题

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


   再说一下this.connectivityCheckFuture被创建的新任务重新赋值的问题:
   checkConnectivity异步创建的任务在结束前判断是否有新task,如果有就再次调用checkConnectivity:
   1. this.connectivityCheckFuture在checkConnectivity方法返回调用者之后又被赋了新值,但调用者并不知情;
   2. 调用者在旧的connectivityCheckFuture上等待的结果就是新task未执行完,调用者就继续执行后面的代码,然后出问题,比如:
   https://github.com/apache/dubbo/runs/4130565263?check_suite_focus=true
   ```
   2021-11-07T11:46:56.1815610Z [ERROR] Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.19 s <<< FAILURE! - in org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest
   2021-11-07T11:46:56.1818867Z [ERROR] org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest.testRetry  Time elapsed: 0.007 s  <<< FAILURE!
   2021-11-07T11:46:56.1820680Z org.opentest4j.AssertionFailedError: expected: <2> but was: <1>
   2021-11-07T11:46:56.1822662Z 	at org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest.testRetry(ConnectivityValidationTest.java:190)
   ```
   更新:
   还不能简单地在checkConnectivity创建的task里面等待新任务结束,那样就违背了checkConnectivity的设计初衷,为了避免长时间占用connectivityExecutor,checkConnectivity采用的是分批处理的策略,所以PR #9211 最终没有修改checkConnectivity方法,而是修改了ConnectivityValidationTest的waitRefresh方法,将等待条件改为invokersToReconnect列表里没有需要进行recover的invoker。


-- 
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] zrlw edited a comment on issue #9210: [3.0] AbstractDirectory存在NPE以及任务future覆盖问题

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


   其次还有this.connectivityCheckFuture被创建的新任务覆盖的问题:
   checkConnectivity异步创建的任务在结束前判断是否有新task,如果有就再次调用checkConnectivity:
   1. this.connectivityCheckFuture在checkConnectivity方法返回调用者之后又被更新,调用者并不知情;
   2. 调用者在旧的connectivityCheckFuture上等待的结果就是新task未执行完,调用者就继续执行后面的代码,然后出问题,比如:
   https://github.com/apache/dubbo/runs/4130565263?check_suite_focus=true
   ```
   2021-11-07T11:46:56.1815610Z [ERROR] Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.19 s <<< FAILURE! - in org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest
   2021-11-07T11:46:56.1818867Z [ERROR] org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest.testRetry  Time elapsed: 0.007 s  <<< FAILURE!
   2021-11-07T11:46:56.1820680Z org.opentest4j.AssertionFailedError: expected: <2> but was: <1>
   2021-11-07T11:46:56.1822662Z 	at org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest.testRetry(ConnectivityValidationTest.java:190)
   ```


-- 
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] zrlw edited a comment on issue #9210: [3.0] AbstractDirectory存在NPE以及connectivityCheckFuture重新赋值的问题

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


   再说一下this.connectivityCheckFuture被创建的新任务重新赋值的问题:
   checkConnectivity异步创建的任务在结束前判断是否有新task,如果有就再次调用checkConnectivity:
   1. this.connectivityCheckFuture在checkConnectivity方法返回调用者之后又被更新,调用者并不知情;
   2. 调用者在旧的connectivityCheckFuture上等待的结果就是新task未执行完,调用者就继续执行后面的代码,然后出问题,比如:
   https://github.com/apache/dubbo/runs/4130565263?check_suite_focus=true
   ```
   2021-11-07T11:46:56.1815610Z [ERROR] Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.19 s <<< FAILURE! - in org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest
   2021-11-07T11:46:56.1818867Z [ERROR] org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest.testRetry  Time elapsed: 0.007 s  <<< FAILURE!
   2021-11-07T11:46:56.1820680Z org.opentest4j.AssertionFailedError: expected: <2> but was: <1>
   2021-11-07T11:46:56.1822662Z 	at org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest.testRetry(ConnectivityValidationTest.java:190)
   ```


-- 
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] zrlw closed issue #9210: [3.0] AbstractDirectory存在NPE以及connectivityCheckFuture重新赋值的问题

Posted by GitBox <gi...@apache.org>.
zrlw closed issue #9210:
URL: https://github.com/apache/dubbo/issues/9210


   


-- 
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] zrlw commented on issue #9210: [3.0] AbstractDirectory访问invokers,validInvokers对象时未判NULL可导致NPE

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


   派生类和AbstractDirectory一起对AbstractDirectory的成员invokers,validInvokers进行操作违反了开闭原则,代码散落在各个类里面也不利于维护。


-- 
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] zrlw edited a comment on issue #9210: [3.0] AbstractDirectory存在NPE以及connectivityCheckFuture重新赋值的问题

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


   再说一下this.connectivityCheckFuture被创建的新任务重新赋值的问题:
   checkConnectivity异步创建的任务在结束前判断是否有新task,如果有就再次调用checkConnectivity:
   1. this.connectivityCheckFuture在checkConnectivity方法返回调用者之后又被赋了新值,但调用者并不知情;
   2. 调用者在旧的connectivityCheckFuture上等待的结果就是新task未执行完,调用者就继续执行后面的代码,然后出问题,比如:
   https://github.com/apache/dubbo/runs/4130565263?check_suite_focus=true
   ```
   2021-11-07T11:46:56.1815610Z [ERROR] Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.19 s <<< FAILURE! - in org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest
   2021-11-07T11:46:56.1818867Z [ERROR] org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest.testRetry  Time elapsed: 0.007 s  <<< FAILURE!
   2021-11-07T11:46:56.1820680Z org.opentest4j.AssertionFailedError: expected: <2> but was: <1>
   2021-11-07T11:46:56.1822662Z 	at org.apache.dubbo.rpc.cluster.support.ConnectivityValidationTest.testRetry(ConnectivityValidationTest.java:190)
   ```


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