Skip to content

Netty: Extend AsyncHandlerExtensions with new callbacks #732

Closed
@kstokoz

Description

@kstokoz

To have a better understanding where is ms spent during execution of request I would like to propose to extend existing callbacks for both 1.8.x and 1.9.x (in 1.9 we have now few more callbacks compared to 1.8.x) with callabacks for:

  • after DNS resolution is complete

In NettyRequestSender:

private ChannelFuture connect(Request request, Uri uri, ProxyServer proxy, boolean useProxy, ClientBootstrap bootstrap, AsyncHandler<?> asyncHandler) {

    InetSocketAddress remoteAddress = remoteAddress(request, uri, proxy, useProxy);
    // callback that Dns resolution is complete
    ...
}
  • ssl handshake complete

Some background

Although it is expected that DNS resolution is very fast it is not that fast everywhere, in China Region DNS in general very slow. Unix-systems have a default system timeout of 5s and 3 attempts for DNS resolution.
In this case you can requests >15s even your request timeout on async client side is 1-2s.

As to ssl handshake, even there is an option to set timeout for ssl handshake it would be in general nice to see how long it take to complete it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions