Alexey Serbin has submitted this change and it was merged.

Change subject: [util] added Subprocess::GetExitStatus()
......................................................................


[util] added Subprocess::GetExitStatus()

The Subprocess::GetExitStatus() method allows to retrive exit status
and exit information in printable form.  That facilitates reporting
proper exit status for a sub-processes if using Subprocess::Wait().

The motivation for this change was to free the users of the Subprocess
interface of calling WIFEXITED/WEXITSTATUS and friends, duplicating
that code over and over.  In some cases, callers did not use
WEXITSTATUS or WTERMSIG and mistakenly interpreted wait status
as sub-process exit status.  In short, most users of the Subprocess
interface need exit status of a sub-process, not wait status.

Also, addressed the race when a signal arrives to the child process
before it calls execve().  Todd suggested to use the trick with
a pipe and O_CLOEXEC option.

Change-Id: Ic2b16e2a2a53a01982f816b9ee41cc61fd93d4bf
Reviewed-on: http://gerrit.cloudera.org:8080/4648
Reviewed-by: Adar Dembo <a...@cloudera.com>
Tested-by: Alexey Serbin <aser...@cloudera.com>
---
M src/kudu/benchmarks/tpch/tpch_real_world.cc
M src/kudu/integration-tests/external_mini_cluster.cc
M src/kudu/integration-tests/full_stack-insert-scan-test.cc
M src/kudu/util/pstack_watcher.cc
M src/kudu/util/subprocess-test.cc
M src/kudu/util/subprocess.cc
M src/kudu/util/subprocess.h
7 files changed, 259 insertions(+), 103 deletions(-)

Approvals:
  Adar Dembo: Looks good to me, approved
  Alexey Serbin: Verified



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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic2b16e2a2a53a01982f816b9ee41cc61fd93d4bf
Gerrit-PatchSet: 13
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Alexey Serbin <aser...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <a...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com>
Gerrit-Reviewer: Dinesh Bhat <din...@cloudera.com>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <t...@apache.org>

Reply via email to