Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
2.7.0
-
None
-
None
-
None
Description
Currently we are audit logging the unsuccessful namesystem calls while holding fslock.
Following is just one example.
FSNamesystem.java
HdfsFileStatus getFileInfo(final String src, boolean resolveLink) throws IOException { final String operationName = "getfileinfo"; checkOperation(OperationCategory.READ); HdfsFileStatus stat = null; readLock(); try { checkOperation(OperationCategory.READ); stat = FSDirStatAndListingOp.getFileInfo(dir, src, resolveLink); } catch (AccessControlException e) { logAuditEvent(false, operationName, src); //<---- audit logging while holding fs read lock. throw e; } finally { readUnlock(operationName); } logAuditEvent(true, operationName, src); return stat; }
We should avoid doing this.