bipinprasad commented on code in PR #3640:
URL: https://github.com/apache/storm/pull/3640#discussion_r1631826169
##########
storm-server/src/main/java/org/apache/storm/utils/ServerUtils.java:
##########
@@ -1102,6 +1102,17 @@ public static int getUserId(String user) {
cmdArgs.add("-u");
if (user != null && !user.isEmpty()) {
cmdArgs.add(user);
+ int exitCode = 0;
+ try {
+ exitCode = new ProcessBuilder(cmdArgs).start().waitFor();
+ } catch (Exception e) {
+ // Ignore
+ } finally {
+ if (exitCode != 0) {
+ LOG.debug("CMD: '{}' returned exit code of {}",
String.join(" ", cmdArgs), exitCode);
+ cmdArgs.remove(user);
+ }
+ }
}
LOG.debug("CMD: {}", String.join(" ", cmdArgs));
ProcessBuilder pb = new ProcessBuilder(cmdArgs);
Review Comment:
Still need this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]