[
https://issues.apache.org/jira/browse/ZOOKEEPER-1998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15325543#comment-15325543
]
Michael Han commented on ZOOKEEPER-1998:
----------------------------------------
I think MESOS-2681 is not directly affected by this issue (ZOOKEEPER-1998). The
problematic code path we are talking about here in ZOOKEEPER-1998 is a
different code path: *zookeeper_interest* is the entry point instead of
*zookeeper_init*.
What Mesos experienced was caused by *Mesos forcefully expires session
(locally) if it is disconnected from ZK for >10s.* according to the comment
made in MESOS-2681, and when ZK client in Mesos tried to re-establish the
session it was the *zookeeper_init()* code gets called (which, would call
resolve_hosts). I tend to think the proper fix on Mesos side would be to try
avoid frequent session expiration if possible, which would reduce the attempts
to re-establishment of sessions and thus reduces the DNS lookup.
> C library calls getaddrinfo unconditionally from zookeeper_interest
> -------------------------------------------------------------------
>
> Key: ZOOKEEPER-1998
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1998
> Project: ZooKeeper
> Issue Type: Bug
> Components: c client
> Affects Versions: 3.5.0
> Reporter: Raul Gutierrez Segales
> Assignee: Raul Gutierrez Segales
> Priority: Critical
> Fix For: 3.5.2, 3.6.0
>
>
> (commented this on ZOOKEEPER-338)
> I've just noticed that we call getaddrinfo from zookeeper_interest... on
> every call. So from zookeeper_interest we always call update_addrs:
> https://github.com/apache/zookeeper/blob/trunk/src/c/src/zookeeper.c#L2082
> which in turns unconditionally calls resolve_hosts:
> https://github.com/apache/zookeeper/blob/trunk/src/c/src/zookeeper.c#L787
> which does the unconditional calls to getaddrinfo:
> https://github.com/apache/zookeeper/blob/trunk/src/c/src/zookeeper.c#L648
> We should fix this since it'll make 3.5.0 slower for people relying on DNS. I
> think this is happened as part of ZOOKEEPER-107 in which the list of servers
> can be updated.
> cc: [~shralex], [~phunt], [~fpj]
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)