Adar Dembo has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/9810 )

Change subject: KUDU-2377: cap GetResourceLimit return value at kint32max
......................................................................


Patch Set 2:

(1 comment)

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

http://gerrit.cloudera.org:8080/#/c/9810/1/src/kudu/util/env_posix.cc@1591
PS1, Line 1591:     PCHECK(getrlimit(ResourceLimitTypeToUnixRlimit(t), &l) == 
0);
> Looks like rlim_cur is a __uint64_t. Maybe it's worth a comment to specify
Like Grant said, RLIM_INFINITY is defined to be -1, which works out to 2^63-1 
when converted to uint64_t and thus exceeds kint32max. This was borne out in 
the testing I did. Are you implying that the implicit type conversion is 
unsafe, and that I should add an explicit conversion somewhere here?

Anyway I added a comment too.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0d30ebd5447867d4227974e64786cc48fdbf2688
Gerrit-Change-Number: 9810
Gerrit-PatchSet: 2
Gerrit-Owner: Adar Dembo <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Grant Henke <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <[email protected]>
Gerrit-Comment-Date: Tue, 27 Mar 2018 04:44:31 +0000
Gerrit-HasComments: Yes

Reply via email to