[
https://issues.apache.org/jira/browse/ZOOKEEPER-2338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16256282#comment-16256282
]
ASF GitHub Bot commented on ZOOKEEPER-2338:
-------------------------------------------
Github user phunt commented on the issue:
https://github.com/apache/zookeeper/pull/410
> I am not sure how
Yea, same here I'm afraid.
In thinking about it a bit perhaps what we could do is one of the following
two option (might be more):
1) add it with some extra tooling in autoconf (and probably now cmake
since it was recently introduced). Basically: add a new flag that the user
(person compiling the library) could use to enable/disable SOCK_CLOEXEC when
running ./configure.
In 3.5 the default behavior would be to not use SOCK_CLOEXEC regardless
whether it's supported or not (user can override default with the option). In
3.6 and later we'd make SOCK_CLOEXEC the default and call it out as a potential
issue as part of the release notes (disable with the option in this case).
2) it seems like we could do similar with a runtime property that the user
could set in code prior to running zookeeper_init that would be global in
nature. e.g. zoo_deterministic_conn_order
Again the defaults would be as specified in 1) above.
Thoughts?
> c bindings should create socket's with SOCK_CLOEXEC to avoid fd leaks on
> fork/exec
> ----------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-2338
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2338
> Project: ZooKeeper
> Issue Type: Bug
> Components: c client
> Reporter: James DeFelice
>
> I've observed socket FD leaks in Apache Mesos when using ZK to coordinate
> master leadership: https://issues.apache.org/jira/browse/MESOS-4065
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)