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/05 07:12:09 UTC

[GitHub] [dubbo] zrlw edited a comment on issue #8675: [3.0] 单元测试org.apache.dubbo.config.spring.schema.GenericServiceTest的问题

zrlw edited a comment on issue #8675:
URL: https://github.com/apache/dubbo/issues/8675#issuecomment-913098640


   从github构建日志看,genericServiceWithoutInterface.$invoke这个ReferenceBean是lazy initializing: 
   ```
   2021-09-04T20:19:48.3314340Z 20:19:47.115 [main] DEBUG org.apache.dubbo.config.spring.ReferenceBean$DubboReferenceLazyInitTargetSource - Initializing lazy target object
   ```
   也就是说单元测试执行到下面这条语句时才会创建这个ReferenceBean:
   ```
   result = genericServiceWithoutInterfaceRef.$invoke("sayHello", new String[]{"java.lang.String"}, new Object[]{"generic"});
   ```
   但是ReferenceConfig的init方法最后要调用checkInvokerAvailable去检查invoker连接是否已经ok,节奏是不是有点太快了,延迟初始化的ReferenceBean刚完成构建,相关的连接立马就ok?
   github日志显示40多ms后,main线程收到一个null应答后就开始执行Unsubscribe操作了,这时候checkInvokerAvailable应该已经抛过异常了:
   ```
   2021-09-04T20:19:48.3751852Z 20:19:47.246 [main-SendThread(MiningMadness.com:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x10000493ad40000, packet:: clientPath:null serverPath:null finished:false header:: 147,2  replyHeader:: 147,41,0  request:: '/dubbo/org.apache.dubbo.config.spring.api.LocalMissClass/consumers/dubbo%253A%252F%252F172.17.16.1%252Forg.apache.dubbo.config.spring.api.LocalMissClass%253Fapplication%253Ddubbo-generic-consumer%2526category%253Dconsumers%2526check%253Dfalse%2526dubbo%253D2.0.2%2526file.cache%253Dfalse%2526generic%253Dtrue%2526init%253Dfalse%2526interface%253Dorg.apache.dubbo.config.spring.api.LocalMissClass%2526metadata-type%253Dremote%2526pid%253D6992%2526release%253D3.0.3-SNAPSHOT%2526side%253Dconsumer%2526sticky%253Dfalse%2526timestamp%253D1630786787116,-1  response:: null
   2021-09-04T20:19:48.3759385Z [04/09/21 20:19:47:247 UTC] main  INFO zookeeper.ZookeeperRegistry:  [DUBBO] Unsubscribe: dubbo://172.17.16.1/org.apache.dubbo.config.spring.api.LocalMissClass?application=dubbo-generic-consumer&category=providers,configurators,routers&dubbo=2.0.2&file.cache=false&generic=true&init=false&interface=org.apache.dubbo.config.spring.api.LocalMissClass&metadata-type=remote&pid=6992&release=3.0.3-SNAPSHOT&side=consumer&sticky=false&timestamp=1630786787116, dubbo version: 3.0.3-SNAPSHOT, current host: 172.17.16.1
   ```
   完整日志见:
   https://github.com/apache/dubbo/runs/3514650085?check_suite_focus=true  点设置里的download log archive,下载后打开里面的 4_Unit Test On windows-2019 (JDK 11).txt,文件很大,记事本打不开或者龟速,需要用notepad++之类的大文件编辑工具看。


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