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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to