You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Stark Arya (Jira)" <ji...@apache.org> on 2022/05/06 13:02:00 UTC

[jira] [Created] (TINKERPOP-2740) first request suspend more than 9s when using gremlin-java-driver

Stark Arya created TINKERPOP-2740:
-------------------------------------

             Summary: first request suspend more than 9s when using gremlin-java-driver
                 Key: TINKERPOP-2740
                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2740
             Project: TinkerPop
          Issue Type: Improvement
          Components: driver
    Affects Versions: 3.6.0, 3.4.3
            Reporter: Stark Arya


when user use gremlin-driver in private cloud environment, 

In AUTHENTICATE rsp func, client need reverse name lookup  through DNS, which will take more than 9s in certain env;  the calling code slice:

 
{code:java}
Handler.GremlinSaslAuthenticationHandler.channelRead0       
 saslClient.set(this.saslClient(this.getHostName(channelHandlerContext)));
  
private String getHostName(final ChannelHandlerContext channelHandlerContext) {
return((InetSocketAddress)channelHandlerContext.channel().remoteAddress()).getAddress().getCanonicalHostName();
}
{code}
there are many talks about this talks about this question.

[https://www.thecodingforums.com/threads/very-slow-ssl-connection-from-win-to-linux.147274/#post-2959030]

[https://stackoverflow.com/questions/3193936/how-to-disable-javas-ssl-reverse-dns-lookup]

 

I think we can rewrite the getHostName like this(use getHostAddress):
{code:java}
private String getHostName(final ChannelHandlerContext channelHandlerContext)  {
    return ((InetSocketAddress)channelHandlerContext.channel().remoteAddress()).getAddress().getHostAddress();
} {code}
all versions seed affected

 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)