Alexey Serbin has posted comments on this change.

Change subject: [util] fixed env-test on OS X
......................................................................


Patch Set 2:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/5738/2/src/kudu/util/env_posix.cc
File src/kudu/util/env_posix.cc:

Line 1274:       uint64_t limit = 0;
> Hmm, is it possible that uint64_t is the wrong type, and we should be using
This behavior is documented in sysctlbyname() man page: 

https://www.freebsd.org/cgi/man.cgi?query=sysctlbyname&apropos=0&sektion=3&format=html


     The information is copied into the buffer specified by oldp.  The size of
     the buffer is given by the location specified by oldlenp before the call,
     and that location gives the amount of data copied after a successful call
     and after a call that returns with the error code ENOMEM.  If the amount
     of data available is greater than the size of the buffer supplied, the
     call supplies as much data as fits in the buffer provided and returns
     with the error code ENOMEM.  If the old value is not desired, oldp and
     oldlenp should be set to NULL.

This is not a strange behavior and it's deterministic.  The function writes 
only the necessary bits, and returning the number of bytes written in the len 
parameter back.  The non-deterministic part is in non-initialized variable.

Using 32-bit type is also an option: sysctlbyname man page on MacOS man page 
states that kern.maxfilesperproc returns 32-bit int.  But what what wrong with 
using 64-bit?

If you prefer giving it exactly what it needs (32-bit) -- fine, I'll update 
this.


-- 
To view, visit http://gerrit.cloudera.org:8080/5738
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic355912b98b3fa592481e2457147e23de98447ea
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Dinesh Bhat <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-HasComments: Yes

Reply via email to