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/14 04:47:03 UTC

[GitHub] [dubbo] kylixs commented on issue #8985: [3.0] RpcException/RuntimeException when Provider jvm exit

kylixs commented on issue #8985:
URL: https://github.com/apache/dubbo/issues/8985#issuecomment-942943406


   Some work is done in https://github.com/apache/dubbo/pull/9033, pls check it.
   1. The application destroy processing is changed: https://github.com/apache/dubbo/pull/9033#discussion_r728613024
   2. prevent refresh metadata in application stopping.
   ```java
           if (registered) {
               // scheduled task for updating Metadata and ServiceInstance
               asyncMetadataFuture = executorRepository.getSharedScheduledExecutor().scheduleAtFixedRate(() -> {
   
                   // ignore refresh metadata on stopping
                   ApplicationDeployer deployer = applicationModel.getDeployer();
                   if (deployer != null && (deployer.isStopping() || deployer.isStopped())) {
                       return;
                   }
   
                   InMemoryWritableMetadataService localMetadataService = (InMemoryWritableMetadataService) WritableMetadataService.getDefaultExtension(applicationModel);
                   localMetadataService.blockUntilUpdated();
                   try {
                       ServiceInstanceMetadataUtils.refreshMetadataAndInstance(serviceInstance);
                   } catch (Exception e) {
                       logger.error("Refresh instance and metadata error", e);
                   } finally {
                       localMetadataService.releaseBlock();
                   }
               }, 0, ConfigurationUtils.get(applicationModel, METADATA_PUBLISH_DELAY_KEY, DEFAULT_METADATA_PUBLISH_DELAY), TimeUnit.MILLISECONDS);
           }
   
   ```


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