You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Andrew Wong (Code Review)" <ge...@cloudera.org> on 2020/03/28 10:30:59 UTC
[kudu-CR] subprocess: use a fifo instead of stdout for IO
Hello Tidy Bot, Attila Bukor, Kudu Jenkins, Adar Dembo, Grant Henke, Hao Hao,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/15574
to look at the new patch set (#3).
Change subject: subprocess: use a fifo instead of stdout for IO
......................................................................
subprocess: use a fifo instead of stdout for IO
Today, communication from a Kudu Java subprocess to the C++
SubprocessServer is done via the subprocess's stdout (the C++ message
protocol listens on the stdout FD of the subprocess). This is risky
because any amount of logging by the subprocess to stdout may end up
breaking the message protocol, preventing any calls to the subprocess
from succeeding.
This updates the Kudu subprocess module on both the Java and C++ side to
use a fifo for output instead of the subprocess's stdout. For Ranger,
this fifo will by default be placed in the Ranger config directory,
which, in some distributions (e.g. CDPD) will be unique per Kudu
process. Additionally ,the name of this file is chosen to avoid
collisions with existing fifos.
This patch also updates the subprocess to share stdout and stderr with
the parent process by default, adding basic log4j configuration to the
Java subprocess to output to System.out. Here's a snippet of the glog
output from subprocess_proxy-test:
0 [pool-1-thread-1] DEBUG org.apache.kudu.subprocess.QueueUtil - Message: org.apache.kudu.subprocess.InboundRequest@48c4ccb9 has been put on the queue
0 [pool-2-thread-1] DEBUG org.apache.kudu.subprocess.QueueUtil - Message: org.apache.kudu.subprocess.InboundRequest@48c4ccb9 has been taken from the queue
1096 [pool-2-thread-1] DEBUG org.apache.kudu.subprocess.QueueUtil - Message: org.apache.kudu.subprocess.OutboundResponse@6c275a0f has been put on the queue
1096 [pool-3-thread-1] DEBUG org.apache.kudu.subprocess.QueueUtil - Message: org.apache.kudu.subprocess.OutboundResponse@6c275a0f has been taken from the queue
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0327 23:35:20.583730 244412416 server.cc:279] Received an EOF from the subprocess
I0327 23:35:20.590333 244948992 server.cc:412] outbound queue shut down: Aborted:
I considered using Netty's FileDescriptor[1] to leverage the FDs from
calls to pipe(). I opted not to since that brought in some hairiness
around its usage of JNI (I saw an UnsatisfiedLinkError when I tried
writing to the FD).
[1] https://netty.io/4.0/api/io/netty/channel/unix/FileDescriptor.html
Change-Id: I63e91a090fe196713a013d28301c7980e452456c
---
M java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/SubprocessConfiguration.java
M java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/SubprocessExecutor.java
M src/kudu/master/catalog_manager.cc
M src/kudu/master/ranger_authz_provider.cc
M src/kudu/master/ranger_authz_provider.h
M src/kudu/ranger/ranger_client-test.cc
M src/kudu/ranger/ranger_client.cc
M src/kudu/ranger/ranger_client.h
M src/kudu/subprocess/server.cc
M src/kudu/subprocess/server.h
M src/kudu/subprocess/subprocess_proxy-test.cc
M src/kudu/subprocess/subprocess_proxy.h
M src/kudu/subprocess/subprocess_server-test.cc
13 files changed, 154 insertions(+), 30 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/74/15574/3
--
To view, visit http://gerrit.cloudera.org:8080/15574
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I63e91a090fe196713a013d28301c7980e452456c
Gerrit-Change-Number: 15574
Gerrit-PatchSet: 3
Gerrit-Owner: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)