This is an automated email from the ASF dual-hosted git repository. zghao pushed a commit to branch branch-2.2 in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.2 by this push: new c088fa0 HBASE-21814 Remove the TODO in AccessControlLists#addUserPermission c088fa0 is described below commit c088fa02d1a4c2053ff82df0b29d879668dd6faa Author: Guanghao Zhang <zg...@apache.org> AuthorDate: Thu Jan 31 09:56:05 2019 +0800 HBASE-21814 Remove the TODO in AccessControlLists#addUserPermission --- .../hadoop/hbase/security/access/AccessControlLists.java | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java index 7560a93..b5bf3a4 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java @@ -24,7 +24,6 @@ import java.io.DataInputStream; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -184,20 +183,7 @@ public class AccessControlLists { ); } try { - /** - * TODO: Use Table.put(Put) instead. This Table.put() happens within the RS. We are already in - * AccessController. Means already there was an RPC happened to server (Actual grant call from - * client side). At RpcServer we have a ThreadLocal where we keep the CallContext and inside - * that the current RPC called user info is set. The table on which put was called is created - * via the RegionCP env and that uses a special Connection. The normal RPC channel will be by - * passed here means there would have no further contact on to the RpcServer. So the - * ThreadLocal is never getting reset. We ran the new put as a super user (User.runAsLoginUser - * where the login user is the user who started RS process) but still as per the RPC context - * it is the old user. When AsyncProcess was used, the execute happen via another thread from - * pool and so old ThreadLocal variable is not accessible and so it looks as if no Rpc context - * and we were relying on the super user who starts the RS process. - */ - t.put(Collections.singletonList(p)); + t.put(p); } finally { t.close(); }