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 2022/03/17 01:07:10 UTC

[GitHub] [dubbo] ailanjieqi opened a new issue #9799: MetadataUtils.getRemoteMetadata throw exception but no log print

ailanjieqi opened a new issue #9799:
URL: https://github.com/apache/dubbo/issues/9799


   <!-- 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: 3.0.6
   * Operating System version: windows
   * Java version: 1.8
   
   ### Steps to reproduce this issue
   
   1. we customize a filter for consumer remote call performance analysis,when we call RpcContext.getContext().isConsumerSide(),then throw a NullException,How i find it,Here is the process
   2. change privoder -Ddubbo.application.register-mode=instance
   3. consumer config is dubbo.application.service-discovery.migration=APPLICATION_FIRST
   4. when dubbo code call MetadataUtils.getRemoteMetadata  throws null point exception in catch block :catch (Exception e) {},but no log print
   
   Pls. provide [GitHub address] to reproduce this issue.
   
   ### Expected Behavior
   
   <!-- What do you expect from the above steps?-->
   Can I print logs
   
   ### Actual Behavior
   
   <!-- What actually happens? -->
   If you don't debug the source code, you can't find the reason at all
   
   If there is an exception, please attach the exception trace:
   
   ```
   public static MetadataInfo getRemoteMetadata(String revision, ServiceInstance instance, MetadataReport metadataReport) {
           String metadataType = ServiceInstanceMetadataUtils.getMetadataStorageType(instance);
           MetadataInfo metadataInfo;
           try {
               if (logger.isDebugEnabled()) {
                   logger.debug("Instance " + instance.getAddress() + " is using metadata type " + metadataType);
               }
               if (REMOTE_METADATA_STORAGE_TYPE.equals(metadataType)) {
                   metadataInfo = MetadataUtils.getMetadata(revision, instance, metadataReport);
               } else {
                   // change the instance used to communicate to avoid all requests route to the same instance
                   MetadataService metadataServiceProxy = MetadataUtils.getMetadataServiceProxy(instance);
                   metadataInfo = metadataServiceProxy.getMetadataInfo(ServiceInstanceMetadataUtils.getExportedServicesRevision(instance));
                   MetadataUtils.destroyMetadataServiceProxy(instance);
               }
           } catch (Exception e) {
              //todo please add log print
               metadataInfo = null;
           }
   
           if (metadataInfo == null) {
               metadataInfo = MetadataInfo.EMPTY;
           }
           return metadataInfo;
       }
   ```
   


-- 
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] ailanjieqi edited a comment on issue #9799: MetadataUtils.getRemoteMetadata throw exception but no log print

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


   if fix ClusterFIlter only ,when only use filter chain ,find  Context from filter chain will find null invoker info then throw null exception ,such as above code  only use filter chain: 
   metadataServiceProxy.getMetadataInfo(ServiceInstanceMetadataUtils.getExportedServicesRevision(instance));


-- 
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 #9799: MetadataUtils.getRemoteMetadata throw exception but no log print

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


   Already fixed.


-- 
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] ailanjieqi commented on issue #9799: MetadataUtils.getRemoteMetadata throw exception but no log print

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


   if only invoker filter, fix ClusterFIlter ,but only use filter chain such , when find  Context from filter chain will find null invoker info then throw null exception ,such as above code  only use filter chain: 
   metadataServiceProxy.getMetadataInfo(ServiceInstanceMetadataUtils.getExportedServicesRevision(instance));


-- 
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 #9799: MetadataUtils.getRemoteMetadata throw exception but no log print

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


   


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