weibocom / motan

A cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.
Other
5.9k stars 1.78k forks source link

比较诡异的现象 #655

Open targerr opened 6 years ago

targerr commented 6 years ago

服务启动正常,但是client启动报错,但是可以正常访问

   配置 connectTimeout="20000", requestTimeout="10000"
    配置文件如下图

client 启动报错信息 2018-02-01 11:25:52,002 [AbstractPoolClient-initPool--1-thread-1] ERROR error - NettyClient init pool create connect Error: url=motan://122..212.89:8002/com.toltech.pay.service.biz.OrderService com.weibo.api.motan.exception.MotanServiceException: error_message: NettyChannel connect to server timeout url: motan://122..212.89:8002/com.toltech.pay.service.biz.OrderService, cost: 1000, result: false, success: false, connected: false, status: 503, error_code: 10001,r=null at com.weibo.api.motan.transport.netty.NettyChannel.open(NettyChannel.java:149) at com.weibo.api.motan.transport.netty.NettyChannelFactory.makeObject(NettyChannelFactory.java:53) at org.apache.commons.pool.impl.GenericObjectPool.addObject(GenericObjectPool.java:1691) at com.weibo.api.motan.transport.AbstractPoolClient.createConnections(AbstractPoolClient.java:93) at com.weibo.api.motan.transport.AbstractPoolClient.access$000(AbstractPoolClient.java:35) at com.weibo.api.motan.transport.AbstractPoolClient$1.run(AbstractPoolClient.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) 2018-02-01 11:25:52,059 [AbstractPoolClient-initPool--1-thread-2] ERROR error - NettyClient init pool create connect Error: url=motan://122..212.89:8002/com.toltech.pay.service.biz.UnifyPayService com.weibo.api.motan.exception.MotanServiceException: error_message: NettyChannel connect to server timeout url: motan://122..***.89:8002/com.toltech.pay.service.biz.UnifyPayService, cost: 1000, result: false, success: false, connected: false, status: 503, error_code: 10001,r=null at com.weibo.api.motan.transport.netty.NettyChannel.open(NettyChannel.java:149) at com.weibo.api.motan.transport.netty.NettyChannelFactory.makeObject(NettyChannelFactory.java:53) at org.apache.commons.pool.impl.GenericObjectPool.addObject(GenericObjectPool.java:1691) at com.weibo.api.motan.transport.AbstractPoolClient.createConnections(AbstractPoolClient.java:93) at com.weibo.api.motan.transport.AbstractPoolClient.access$000(AbstractPoolClient.java:35) at com.weibo.api.motan.transport.AbstractPoolClient$1.run(AbstractPoolClient.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

rayzhang0603 commented 6 years ago

client端refer配置的connectTimeout是1000,是不是网络状况不好?可以适当调大connectTimeout,例如5000试试

rayzhang0603 commented 6 years ago

你这个异常是client连server超时,不是链接zk超时,你前面设置的是zk的connectTimeout

slowwalkerlcr commented 6 years ago

@rayzhang0603 请问client连server超时在哪里配置的,我看默认是1000,就是找不到在哪里可以自定义配置

rayzhang0603 commented 6 years ago

配置referer或者basicreferer的connectTimeout参数就可以