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

ASF subversion and git services commented on GEODE-9128:
--------------------------------------------------------

Commit 638ea504280b5e36474bcec86c82b0813875da15 in geode's branch 
refs/heads/support/1.14 from Bruce Schuchardt
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=638ea50 ]

GEODE-9128: Remove host name look-up from JGAddress (#6298)

toString() was including the host name of the address, which is overkill
for the limited use of JGAddress.

JGroupsMessenger's logging that included this class wasn't checking the
log level before invoking logDebug() and other methods.  I've added
that.

(cherry picked from commit 8e1c7cdbab0fe806de14355af4dae938f8ddedda)


> Remove host name look-up from JGAddress
> ---------------------------------------
>
>                 Key: GEODE-9128
>                 URL: https://issues.apache.org/jira/browse/GEODE-9128
>             Project: Geode
>          Issue Type: Test
>          Components: membership
>            Reporter: Bruce J Schuchardt
>            Assignee: Bruce J Schuchardt
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.13.3, 1.15.0
>
>
> The method JGAddress.toString() contains a host name lookup that should be 
> removed.  It should just log the toString of its ip_addr field, not 
> ip_addr.getHostName().  That method can cause a reverse-DNS lookup, which is 
> needlessly expensive for a toString() operation.
> {code:java}
>   public String toString() {
>     StringBuilder sb = new StringBuilder();
>     if (ip_addr == null)
>       sb.append("<null>");
>     else {
>       sb.append(ip_addr.getHostName());
>     }
>     if (vmViewId >= 0) {
>       sb.append("<v").append(vmViewId).append('>');
>     }
>     if (SHOW_UUIDS) {
>       sb.append("(").append(toStringLong()).append(")");
>     } else if (mostSigBits == 0 && leastSigBits == 0) {
>       sb.append("(no uuid set)");
>     }
>     sb.append(":").append(port);
>     return sb.toString();
>   }
> {code:java}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to