Closed yuandong1222 closed 8 years ago
I think ConnectionTimeout is not a Request level options, it's better to put the option in RpcClientOptions
I impl this opinion as a RpcController's member since connecting to different may need different timeout.
But in fact, the connection is transparent to user, and all rpc channels using the same RpcClient will share the same connections, which means, even for different channels, if their remote addresses (ip:port to be exact) are the same, they will use the same underlying connection. So, setting connection timeout in RpcController is not proper, because it may not take effect when the connection is setting up by another RpcChannel.
Yes, this make sense, I will fix it later.
3ks.
Nice, thanks~
@cyshi, Yes. There is bug in this patch which I fixed and now am testing.
Please don't merge.
Updated, plz review.
@yuandong1222 , is the bug you mentioned several days ago fixed now? and no core appeared any more?
@qinzuoyan Yes, I fix it. This is because I bind with this not _shared_fromthis.
This path is used on our online services which has more than 1k nodes now and everything runs fine, I think it is OK.
Nice, merged, thanks for your contribution.
A new option of rpc_controller connect_timeout is used for connect action.
When rpc_client use rpc_stream to create a connect, it will use rpc_controller::connect_timeout for connect action if it is > 0.
The default of rpc_controller::connect_timeout is -1.
Signed-off-by: Dong Yuan yuandong1222@gmail.com