Repository: kudu
Updated Branches:
refs/heads/branch-1.2.x 874f69b96 -> 51d8c5091
[util] fixed env-test on OS X
Prior to the fix, in some cases the uninitialized portion of 64-bit
variable was non-zero and since the sysctlbyname("kern.maxfilesperproc")
call output just 4 bytes, the value of the captured system property
was wrong. Calling setrlimit() with astronomical values
did not succeed, failing the env-test test.
Change-Id: Ic355912b98b3fa592481e2457147e23de98447ea
Reviewed-on: http://gerrit.cloudera.org:8080/5738
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <[email protected]>
Reviewed-on: http://gerrit.cloudera.org:8080/5753
Reviewed-by: Dan Burkert <[email protected]>
Tested-by: Todd Lipcon <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/51d8c509
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/51d8c509
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/51d8c509
Branch: refs/heads/branch-1.2.x
Commit: 51d8c5091a31c3b5c2dacbe8771c484dd5987c6f
Parents: 874f69b
Author: Alexey Serbin <[email protected]>
Authored: Fri Jan 20 12:15:03 2017 -0800
Committer: Todd Lipcon <[email protected]>
Committed: Fri Jan 20 22:26:50 2017 +0000
----------------------------------------------------------------------
src/kudu/util/env_posix.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kudu/blob/51d8c509/src/kudu/util/env_posix.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/env_posix.cc b/src/kudu/util/env_posix.cc
index 984e032..a8bb5d1 100644
--- a/src/kudu/util/env_posix.cc
+++ b/src/kudu/util/env_posix.cc
@@ -1269,9 +1269,11 @@ class PosixEnv : public Env {
// rlim_max (this is consistent with Linux).
// TLDR; OS X 10.11 is wack.
if (l.rlim_max == RLIM_INFINITY) {
- uint64_t limit;
+ uint32_t limit;
size_t len = sizeof(limit);
PCHECK(sysctlbyname("kern.maxfilesperproc", &limit, &len, nullptr, 0) ==
0);
+ // Make sure no uninitialized bits are present in the result.
+ DCHECK_EQ(sizeof(limit), len);
l.rlim_max = limit;
}
#endif