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/10/21 09:02:07 UTC

[GitHub] [dubbo] Holmesus opened a new issue #9086: getMethodParameter(java.lang.String, java.lang.String, java.lang.String)并发修改导致空指针异常

Holmesus opened a new issue #9086:
URL: https://github.com/apache/dubbo/issues/9086


   <!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
   
   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   
   ### Environment
   
   * Dubbo version: 2.7.13
   * Operating System version: Mac OS、Linux
   * Java version: 1.8
   * 方法名
   org.apache.dubbo.metadata.MetadataInfo.ServiceInfo#getMethodParameter(java.lang.String, java.lang.String, java.lang.String)
   ### Steps to reproduce this issue
   出问题的代码
   if (methodParams == null) {
                   methodParams = URL.toMethodParameters(params);
                   consumerMethodParams = URL.toMethodParameters(consumerParams);
     }
   修改为
     Map<String, Map<String, String>> temp = methodParams;
               if (methodParams == null) {
                   methodParams = URL.toMethodParameters(params);
                   if(temp == null){
                       try {
                           Thread.sleep(1000*3);
                       } catch (InterruptedException e) {
                           e.printStackTrace();
                       }
                   }
                   consumerMethodParams = URL.toMethodParameters(consumerParams);
               }
   1. 多线程问题较难复现,采用修改代码的形式模拟
   2. 修改代码
   3. 在sleep的时间内进行两次请求,第一个请求进入sleep,第二个请求出现空指针异常
   
   
   ### Expected Behavior
   
   正常执行
   ### Actual Behavior
   
   由于methodParams已经不为空,consumerMethodParams没有被初始化,执行到342行代码时发生空指针
   
   ```
   Caused by: java.lang.NullPointerException: null
   	at org.apache.dubbo.metadata.MetadataInfo$ServiceInfo.getMethodParameter(MetadataInfo.java:353)
   	at org.apache.dubbo.metadata.MetadataInfo$ServiceInfo.getMethodParameter(MetadataInfo.java:344)
   	at org.apache.dubbo.registry.client.InstanceAddressURL.getServiceMethodParameter(InstanceAddressURL.java:143)
   	at org.apache.dubbo.registry.client.InstanceAddressURL.getMethodParameter(InstanceAddressURL.java:156)
   	at org.apache.dubbo.common.URL.getMethodParameter(URL.java:881)
   	at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.initLoadBalance(AbstractClusterInvoker.java:314)
   	at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:263)
   	at org.apache.dubbo.rpc.cluster.interceptor.ClusterInterceptor.intercept(ClusterInterceptor.java:47)
   	at org.apache.dubbo.rpc.cluster.support.wrapper.AbstractCluster$InterceptorInvokerNode.invoke(AbstractCluster.java:92)
   	at org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:93)
   	at org.apache.dubbo.registry.client.migration.ServiceDiscoveryMigrationInvoker.invoke(ServiceDiscoveryMigrationInvoker.java:59)
   	at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:96)
   	at org.apache.dubbo.common.bytecode.proxy1.sayHello(proxy1.java)
   	at com.sftech.component.DemoServiceComponent.sayHello(DemoServiceComponent.java:41)```
   


-- 
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] chickenlj closed issue #9086: getMethodParameter(java.lang.String, java.lang.String, java.lang.String)并发修改导致空指针异常

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


   


-- 
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] Holmesus commented on issue #9086: getMethodParameter(java.lang.String, java.lang.String, java.lang.String)并发修改导致空指针异常

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


   > I think I can solve it.Please assign it to me.
   
   期待您的回复,隔壁老王同学


-- 
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] wangchengming666 commented on issue #9086: getMethodParameter(java.lang.String, java.lang.String, java.lang.String)并发修改导致空指针异常

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


   > @neighbor-uncleWang Any progress ?
   
   I can fix it.


-- 
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] Holmesus commented on issue #9086: getMethodParameter(java.lang.String, java.lang.String, java.lang.String)并发修改导致空指针异常

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


   > @Holmesus 能不能提供一个可以重现的测试用例呢??就像MetadataInfoTest里面的方法一样
   
   这个不太好复现,我用多线程只复现了一次,是通过修改MetadataInfo的源码稳定重现的,把MetadataInfo复制一份放在IDE中,用sleep让后来的线程先执行后续的代码


-- 
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 #9086: getMethodParameter(java.lang.String, java.lang.String, java.lang.String)并发修改导致空指针异常

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


   @neighbor-uncleWang 
   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] wangchengming666 commented on issue #9086: getMethodParameter(java.lang.String, java.lang.String, java.lang.String)并发修改导致空指针异常

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


   > @neighbor-uncleWang Any progress ?
   
   I can fix it.


-- 
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] wangchengming666 edited a comment on issue #9086: getMethodParameter(java.lang.String, java.lang.String, java.lang.String)并发修改导致空指针异常

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


   > @neighbor-uncleWang Any progress ?
   
   @CrazyHZM  I can fix it.


-- 
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] chickenlj commented on issue #9086: getMethodParameter(java.lang.String, java.lang.String, java.lang.String)并发修改导致空指针异常

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


   This issue has been completely fixed in the latest 3.x release. 


-- 
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] neighbor-uncleWang commented on issue #9086: getMethodParameter(java.lang.String, java.lang.String, java.lang.String)并发修改导致空指针异常

Posted by GitBox <gi...@apache.org>.
neighbor-uncleWang commented on issue #9086:
URL: https://github.com/apache/dubbo/issues/9086#issuecomment-999979910


   > 
   
   问题解决了吗??前段时间接入内网,突然不能访问github了,今天才重新搞好


-- 
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] wangchengming666 edited a comment on issue #9086: getMethodParameter(java.lang.String, java.lang.String, java.lang.String)并发修改导致空指针异常

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


   > @neighbor-uncleWang Any progress ?
   
   @CrazyHZM  I can fix it.


-- 
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] neighbor-uncleWang commented on issue #9086: getMethodParameter(java.lang.String, java.lang.String, java.lang.String)并发修改导致空指针异常

Posted by GitBox <gi...@apache.org>.
neighbor-uncleWang commented on issue #9086:
URL: https://github.com/apache/dubbo/issues/9086#issuecomment-950432338


   @Holmesus 能不能提供一个可以重现的测试用例呢??就像MetadataInfoTest里面的方法一样


-- 
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] neighbor-uncleWang removed a comment on issue #9086: getMethodParameter(java.lang.String, java.lang.String, java.lang.String)并发修改导致空指针异常

Posted by GitBox <gi...@apache.org>.
neighbor-uncleWang removed a comment on issue #9086:
URL: https://github.com/apache/dubbo/issues/9086#issuecomment-999979910


   > 
   
   问题解决了吗??前段时间接入内网,突然不能访问github了,今天才重新搞好


-- 
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] neighbor-uncleWang commented on issue #9086: getMethodParameter(java.lang.String, java.lang.String, java.lang.String)并发修改导致空指针异常

Posted by GitBox <gi...@apache.org>.
neighbor-uncleWang commented on issue #9086:
URL: https://github.com/apache/dubbo/issues/9086#issuecomment-999980570


   > > @neighbor-uncleWang 有进展吗?
   > 
   > @CrazyHZM 我可以修复它。
   @wangchengming666 哈喽,问题搞定了吗??前段时间接入内网,一下子不能访问github了。今天才搞定,能登录上来。
   
   


-- 
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] neighbor-uncleWang commented on issue #9086: getMethodParameter(java.lang.String, java.lang.String, java.lang.String)并发修改导致空指针异常

Posted by GitBox <gi...@apache.org>.
neighbor-uncleWang commented on issue #9086:
URL: https://github.com/apache/dubbo/issues/9086#issuecomment-950443385


   @Holmesus 我想用CAS能解决这个问题。或者两个if判断
   


-- 
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] neighbor-uncleWang commented on issue #9086: getMethodParameter(java.lang.String, java.lang.String, java.lang.String)并发修改导致空指针异常

Posted by GitBox <gi...@apache.org>.
neighbor-uncleWang commented on issue #9086:
URL: https://github.com/apache/dubbo/issues/9086#issuecomment-949336293


   I think I can solve it.Please assign it to me.


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