Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,13 @@ private Set<String> getUnixGroups(String user) throws IOException {
groups = resolvePartialGroupNames(user, e.getMessage(),
executor.getOutput());
} catch (PartialGroupNameException pge) {
LOG.warn("unable to return groups for user {}", user, pge);
if(LOG.isDebugEnabled()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we just extract this into String msg = ""unable to return groups for user {}" and use this msg to make log line looks clean?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smengcl do you think this is fine? or we don't need this in even in Warn?
we were hitting this log message. This current patch voids the full trace in logs when debug is not enabled.

@smengcl smengcl Jun 20, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes IMO we don't need the warn.

@swamirishi Just be sure to double check the debug log can actually be enabled for example by setting org.apache.hadoop.security.ShellBasedUnixGroupsMapping=DEBUG in log4j.properties or JVM -D param.

nit: checkstyle missing space after if

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@swamirishi could you please fix the @smengcl comments above? you need to format line number 218

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this is stale version. Thanks

LOG.debug("unable to return groups for user {}", user, pge);
} else {
LOG.warn("unable to return groups for user {}. " +
"Exception Class: {}, Exception Message: {}",
user, pge.getClass().getName(), pge.getMessage());
}
return EMPTY_GROUPS_SET;
}
}
Expand Down