Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/14425 )
Change subject: KUDU-2971 p1: add subprocess module ...................................................................... Patch Set 2: (1 comment) http://gerrit.cloudera.org:8080/#/c/14425/2/src/kudu/subprocess/subprocess_protocol.cc File src/kudu/subprocess/subprocess_protocol.cc: http://gerrit.cloudera.org:8080/#/c/14425/2/src/kudu/subprocess/subprocess_protocol.cc@164 PS2, Line 164: : Status SubprocessProtocol::DoRead(faststring* buf) { : uint8_t* pos = buf->data(); : size_t rem = buf->length(); : while (rem > 0) { : ssize_t r; : RETRY_ON_EINTR(r, read(read_fd_, pos, rem)); : if (r == -1) { : return Status::IOError("Error reading from pipe", "", errno); : } : if (r == 0) { : return Status::EndOfFile("Other end of pipe was closed"); : } : DCHECK_GE(rem, r); : rem -= r; : pos += r; : } : return Status::OK(); : } : : Status SubprocessProtocol::DoWrite(const faststring& buf) { : const uint8_t* pos = buf.data(); : size_t rem = buf.length(); : while (rem > 0) { : ssize_t r; : RETRY_ON_EINTR(r, write(write_fd_, pos, rem)); : if (r == -1) { : if (errno == EPIPE) { : return Status::EndOfFile("Other end of pipe was closed"); : } : return Status::IOError("Error writing to pipe", "", errno); : } : DCHECK_GE(rem, r); : rem -= r; : pos += r; : } : return Status::OK(); : } : > Did you consider _only_ reusing this so we don't have to couple the subproc Actually, I think reusing all of this is fine; I just don't think we need to multiplex in the same way that we do for ControlShellRequestPB. -- To view, visit http://gerrit.cloudera.org:8080/14425 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If73e27772e1897a04f04229c4906a24c61e361f2 Gerrit-Change-Number: 14425 Gerrit-PatchSet: 2 Gerrit-Owner: Hao Hao <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Hao Hao <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Tidy Bot (241) Gerrit-Comment-Date: Tue, 15 Oct 2019 02:00:27 +0000 Gerrit-HasComments: Yes
