[ 
https://issues.apache.org/jira/browse/TINKERPOP-2740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17550554#comment-17550554
 ] 

ASF GitHub Bot commented on TINKERPOP-2740:
-------------------------------------------

lyndonbauto commented on PR #1683:
URL: https://github.com/apache/tinkerpop/pull/1683#issuecomment-1147634776

   For other people reviewing:
   - 
[getCanonicalHostName](https://docs.oracle.com/javase/7/docs/api/java/net/InetAddress.html#getCanonicalHostName%28%29)
   - 
[getHostName](https://docs.oracle.com/javase/7/docs/api/java/net/InetAddress.html#getHostAddress%28%29)
   
   Based on the spec getHostName does not do a reverse DNS lookup.
   




> 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.4.3, 3.6.0
>            Reporter: Stark Arya
>            Priority: Critical
>
> 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)

Reply via email to