maheshrajus commented on PR #4683:
URL: https://github.com/apache/hive/pull/4683#issuecomment-1803741145
@abstractdog @veghlaci05
I checked the other places where we are using
ugi.doAs((PrivilegedExceptionAction<Void>) () this access check. most of the
places we have as per below. So i am modifying accordingly. the method
signature and catching correct exceptions i modified.
These modifications i tested manually and it is working fine. now the user
which does not have permission to access the queue, they cant run the yarn
jobs. these changes we cant verify with UT.
**working solution:**
public void checkQueueAccess(
String queueName, String userName) throws IOException {
UserGroupInformation ugi = UserGroupInformation.getCurrentUser();
try {
ugi.doAs((PrivilegedExceptionAction<Void>) () -> {
checkQueueAccessInternal(queueName, userName);
return null;
});
} catch (InterruptedException exception) {
// we need to catch only IO exception/Interrupted Exception here,
// as part of HIVE-27029 we are swallowing all exceptions and ignoring
those causing yarn jobs are submitted
LOG.error("Cannot check queue access against UGI: " + ugi, exception);
throw new IOException(exception);
}
}
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]