-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[serving] Improve logging for exec shell command #2569
Conversation
Raising PR on behalf of Frank. |
@@ -54,6 +52,21 @@ public final class LmiUtils { | |||
|
|||
private LmiUtils() {} | |||
|
|||
static void exec(List<String> cmd) throws IOException, InterruptedException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed in this PR - we can do this as a follow up, but might be nice to put this into a generic ProcessUtils class or something similar. We have a few more places where we do this (like cluster request handler)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can make this in ProcessUtils
class, but need to make error checking more generic, this class currently has logic specific for s3cmd:
logOutput.startsWith("ERROR ")
We can pass a regex if caller need extra error checking:
(regex != null && logOutput.matches(regex))
} | ||
int exitCode = exec.waitFor(); | ||
if (0 != exitCode || logOutput.startsWith("ERROR ")) { | ||
logger.info("{}", logOutput); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be logged at error level?
Description
Brief description of what this PR is about
Improve logging for exec shell command