Caused by: com.alibaba.dubbo.remoting.TimeoutException: Waiting server-side response timeout by scan

Posted 爷的眼睛闪亮

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Caused by: com.alibaba.dubbo.remoting.TimeoutException: Waiting server-side response timeout by scan相关的知识,希望对你有一定的参考价值。

方案一:

重启dubbo连接 zookeeper

方案二:

经压测,greys跟踪得知,是dubbo的monitor的问题。主要超时的方法是dubbo的getIP方法,monitor每次收集数据的时候都要根据域名获取zk的IP,这一步耗时很长。

    public String getIp() {
        if (ip == null) {
            ip = NetUtils.getIpByHost(host);
        }
        return ip;
    }

现在改了dubbo的源码,monitor每次收集数据的时候不获取zk的ip,直接用域名。增加如下方法,

    public String toServiceString(boolean useIP){
        return buildString(true, false, useIP, true);
    }

修改AbstractMonitorFactory的方法

    public Monitor getMonitor(URL url) {
        url = url.setPath(MonitorService.class.getName()).addParameter(Constants.INTERFACE_KEY, MonitorService.class.getName());
        String key = url.toServiceString(false);
        LOCK.lock();
        try {
            Monitor monitor = MONITORS.get(key);
            if (monitor != null) {
                return monitor;
            }
            monitor = createMonitor(url);
            if (monitor == null) {
                throw new IllegalStateException("Can not create monitor " + url);
            }
            MONITORS.put(key, monitor);
            return monitor;
        } finally {
            // 释放锁
            LOCK.unlock();
        }
    }

以上是关于Caused by: com.alibaba.dubbo.remoting.TimeoutException: Waiting server-side response timeout by scan的主要内容,如果未能解决你的问题,请参考以下文章

Mathematical Problems Caused by CCD

Caused by SSLError

Caused by: java.lang.NoClassDefFoundError:

caused by a circular import.

异常Caused by: java.lang.ClassNotFoundException: org.springframework.dao.DataIntegrityViolationExcep

Caused by org hibernate DuplicateMappingException Duplicat