-
Notifications
You must be signed in to change notification settings - Fork 7.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ZOOKEEPER-2338] - set SOCK_CLOEXEC on socket if defined #410
Conversation
Hi @fr0stbyte I see in the JIRA that this ticked arises from an issue related to running ZooKeeper Mesos. Would you be able to explain exactly why this is needed? |
@afine Thanks for looking at the PR |
@fr0stbyte Thanks for linking to the Mesos bug. Unfortunately, I am not familiar with the way Mesos handles processes and I think it is possible that other members of the community share my ignorance. Would you mind describing the conditions that are necessary to reproduce this bug? |
@fr0stbyte Reading some Stackoverflow about the flag (https://stackoverflow.com/questions/22304631/what-is-the-purpose-to-set-sock-cloexec-flag-with-accept4-same-as-o-cloexec), the change looks reasonable to me. However it would be beneficial to shed some light on how it's related to your scenario. |
This looks like a non-backward compatible change to me. That said I'm not sure how many clients would rely on this behavior. thoughts? |
@phunt I'd have no problem making in backward compatible, but I am not sure how. Can you offer some guidance here ? |
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):
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).
Again the defaults would be as specified in 1) above. Thoughts? |
@phunt both options seem fine to me. I think would prefer the first one, that way if the library remains ABI compatible, the clients won't need to recompile. |
@phunt Let me know if the changes are inline with what you've had in mind. Once we clear that, I will add the changes for 3.6 |
@fr0stbyte According to my tiny C knowledge, it looks good to me. Are u going to create a separate PR for trunk? |
I tested it with cmake and autotools based generation and the command lines work properly with agreed upon defaults. LGTM. +1. |
Author: Radu Brumariu <radu@groupon.com> Reviewers: phunt@apache.org Closes #410 from fr0stbyte/ZOOKEEPER-2338 Change-Id: I7b060a2dc473b34aecc0cfac71d39720369bd635
Committed to branch-3.5 and master. I tried applying to branch-3.4 but it wouldn't apply cleanly. Please submit another pull request for 3.4 and I'll review/commit that as well. Thanks @fr0stbyte ! |
Author: Radu Brumariu <radu@groupon.com> Reviewers: phunt@apache.org Closes apache#410 from fr0stbyte/ZOOKEEPER-2338 Change-Id: I7b060a2dc473b34aecc0cfac71d39720369bd635 (cherry picked from commit 508293d) Signed-off-by: Patrick Hunt <phunt@apache.org>
Author: Radu Brumariu <radu@groupon.com> Reviewers: phunt@apache.org Closes apache#410 from fr0stbyte/ZOOKEEPER-2338 Change-Id: I7b060a2dc473b34aecc0cfac71d39720369bd635 (cherry picked from commit 508293d) Signed-off-by: Patrick Hunt <phunt@apache.org>
No description provided.