Yingchun Lai has posted comments on this change. ( http://gerrit.cloudera.org:8080/20631 )
Change subject: KUDU-3520 Fix file descriptor leak in encryption ...................................................................... Patch Set 1: Code-Review+1 (3 comments) http://gerrit.cloudera.org:8080/#/c/20631/1/src/kudu/util/env_posix.cc File src/kudu/util/env_posix.cc: http://gerrit.cloudera.org:8080/#/c/20631/1/src/kudu/util/env_posix.cc@1569 PS1, Line 1569: return IOError(fname, errno); Also need to close fd when fseek() failed? http://gerrit.cloudera.org:8080/#/c/20631/1/src/kudu/util/env_posix.cc@2359 PS1, Line 2359: RETURN_NOT_OK(s); Although this is not encryption related, but it's needed to close the fd as well? http://gerrit.cloudera.org:8080/#/c/20631/1/src/kudu/util/env_posix.cc@2366 PS1, Line 2366: RETURN_NOT_OK_EVAL(GenerateHeader(&eh), DoClose(fd)); Is it better to use SCOPED_CLEANUP instead? Then you don't need to close the fd every time it return non-OK. (Remember to cancel() the ScopedCleanup if return OK) -- To view, visit http://gerrit.cloudera.org:8080/20631 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2412429d4fe836b705296e9e30453d7c4d030cec Gerrit-Change-Number: 20631 Gerrit-PatchSet: 1 Gerrit-Owner: Attila Bukor <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Yingchun Lai <[email protected]> Gerrit-Reviewer: Zoltan Chovan <[email protected]> Gerrit-Comment-Date: Mon, 30 Oct 2023 16:07:58 +0000 Gerrit-HasComments: Yes
