KAFKA-7828: Add ExternalCommandWorker to Trogdor#6219
Conversation
|
Any thoughts on using a library like commons-exec or zt-exec? |
|
A lot of the rationale for the zt-exec seems a little more active (it had a release less than a year ago) but still doesn't seem to really solve for the things that I want. Again, a lot of the stuff it mentions is already in the standard java library. For example-- "Redirecting stderr to stdout"-- Java's ProcessBuilder can now do this easily. And so on. In general, most of the complexity in this patch is about dealing with event streams coming into and out of the process. That would be the same even if a different library were used. The JDK's library is the best maintained of any of these libraries, so I think it's the clear choice. The features that I really want that are missing from the the JDK's library are:
#1 is not really a big deal since the subprocess can just flush its stdout as needed, or set line-buffered mode on its own. Also, I don't think any of the other libraries have this. #2 is something we could probably hack up by running a shell command rather than using |
|
Thanks for the explanation @cmccabe. Left a review with several small comments/questions. |
566b5da to
d49d838
Compare
Allow the Trogdor agent to execute external commands. The agent communicates with the external commands via stdin, stdout, and stderr. Based on a patch by Xi Yang <xi@confluent.io> Reviewers: David Arthur <mumrah@gmail.com>
Allow the Trogdor agent to execute external commands. The agent communicates with the external commands via stdin, stdout, and stderr. Based on a patch by Xi Yang xi@confluent.io