Marton Greber has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/24905 )
Change subject: KUDU-3806: add deadline-bounded WaitAndCollect() ...................................................................... KUDU-3806: add deadline-bounded WaitAndCollect() Add Subprocess::WaitAndCollect(), which concurrently drains the child's piped stdout and stderr while waiting for it to exit, up to a deadline. Draining both pipes together means a large write on one cannot deadlock against a full buffer on the other; if the deadline passes first the child is killed (SIGKILL), '*timed_out' is set, and whatever output was collected so far is still returned. To support this, ReadFdsFully() gains a deadline: a one-shot libev timer (DeadlineHelper) breaks the drain loop when it fires, and each fd watcher now decrements a shared open-count so the loop ends deterministically at EOF even with the timer armed. An uninitialized deadline preserves the historical "drain to EOF" behavior, which is what Subprocess::Call() continues to pass. This is groundwork for running each MCP tools/call in a bounded child 'kudu' process. Change-Id: I582ea89b0ada4f723695df8d98d7e5bc0bbc7f7f Co-Authored-By: Claude Opus 4.8 <[email protected]> Reviewed-on: http://gerrit.cloudera.org:8080/24905 Reviewed-by: Gabriella Lotz <[email protected]> Reviewed-by: Alexey Serbin <[email protected]> Tested-by: Marton Greber <[email protected]> --- M src/kudu/util/subprocess-test.cc M src/kudu/util/subprocess.cc M src/kudu/util/subprocess.h 3 files changed, 359 insertions(+), 21 deletions(-) Approvals: Gabriella Lotz: Looks good to me, but someone else must approve Alexey Serbin: Looks good to me, approved Marton Greber: Verified -- To view, visit http://gerrit.cloudera.org:8080/24905 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I582ea89b0ada4f723695df8d98d7e5bc0bbc7f7f Gerrit-Change-Number: 24905 Gerrit-PatchSet: 5 Gerrit-Owner: Marton Greber <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Attila Bukor <[email protected]> Gerrit-Reviewer: Gabriella Lotz <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Marton Greber <[email protected]> Gerrit-Reviewer: Zoltan Chovan <[email protected]> Gerrit-Reviewer: Zoltan Martonka <[email protected]>
