You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "niguibin (via GitHub)" <gi...@apache.org> on 2023/06/09 09:24:10 UTC

[GitHub] [dubbo] niguibin opened a new issue, #12485: 关于 provider 的 sessionTimeout

niguibin opened a new issue, #12485:
URL: https://github.com/apache/dubbo/issues/12485

   
   请问 CuratorFrameworkUtils 这个类的 buildCuratorFramework 方法中创建 CuratorFramework 时为什么没有执行 builder.sessionTimeoutMs(connectionURL.getParameter(SESSION_KEY, DEFAULT_SESSION_TIMEOUT_MS)) 方法,不能自己设置  sessionTimeout 呢
   
   ```
   public class ZookeeperServiceDiscovery extends AbstractServiceDiscovery {
       // ......
     
       public ZookeeperServiceDiscovery(ApplicationModel applicationModel, URL registryURL) {
           super(applicationModel, registryURL);
           try {
               this.curatorFramework = buildCuratorFramework(registryURL, this);
               // ......
           } catch (Exception e) {
               throw new IllegalStateException("Create zookeeper service discovery failed.", e);
           }
       }
   
       public static CuratorFramework buildCuratorFramework(URL connectionURL, ZookeeperServiceDiscovery serviceDiscovery) throws Exception {
           CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder()
               .connectString(connectionURL.getBackupAddress())
               .retryPolicy(buildRetryPolicy(connectionURL));
           String userInformation = connectionURL.getUserInformation();
           if (StringUtils.isNotEmpty(userInformation)) {
               builder = builder.authorization("digest", userInformation.getBytes());
               builder.aclProvider(new ACLProvider() {
                   @Override
                   public List<ACL> getDefaultAcl() {
                       return ZooDefs.Ids.CREATOR_ALL_ACL;
                   }
   
                   @Override
                   public List<ACL> getAclForPath(String path) {
                       return ZooDefs.Ids.CREATOR_ALL_ACL;
                   }
               });
           }
           CuratorFramework curatorFramework = builder.build();
           // ......
           return curatorFramework;
       }
      // ......
   ```
   作为 provider,当该 provider 下线之后,/services/xxx 节点仍然存在,等到默认 60s 之后才会删除,这期间当consumer 端请求该 provider 时就会报如下错误
   ```
   org.apache.dubbo.rpc.StatusRpcException: DEADLINE_EXCEEDED : Waiting server-side response timeout by scan timer. start time: 2023-06-09 17:00:09.431, end time: 2023-06-09 17:00:12.447, timeout: 3000 ms, service: xxx.xxx.xxx
   ```
   
   现在想改短一点 sessionTimeout 就只能修改 zookeeper 配置中的 maxSessionTimeout 或 tickTime 了吗


-- 
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.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] niguibin commented on issue #12485: 关于 provider 的 sessionTimeout

Posted by "niguibin (via GitHub)" <gi...@apache.org>.
niguibin commented on issue #12485:
URL: https://github.com/apache/dubbo/issues/12485#issuecomment-1588480575

   > May fixed in
   
   这个 #9317 中的 CuratorZookeeperClient 应该是控制 /dubbo/xxx.xxx/providers 节点的,而 ZookeeperServiceDiscovery 中的 CuratorFramework 是控制 /services/xxx 节点的,这是两个客户端,我很疑惑,为什么在 CuratorZookeeperClient 中是设置了 sessiontimeout 的,在 ZookeeperServiceDiscovery 中没有设置 sessiontimeout。但是 consumer 端是只有在 /dubbo/xxx.xxx.providers/ 节点和 /services/xxx 节点都不存在时才认为该 provider 不存在了,所以这两个节点的 sessiontimeout 应该要保持一致才对


-- 
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] AlbumenJ commented on issue #12485: 关于 provider 的 sessionTimeout

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #12485:
URL: https://github.com/apache/dubbo/issues/12485#issuecomment-1587237045

   May fixed in #9317


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