[ 
https://issues.apache.org/jira/browse/SENTRY-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16004353#comment-16004353
 ] 

Hadoop QA commented on SENTRY-1759:
-----------------------------------

Here are the results of testing the latest attachment
https://issues.apache.org/jira/secure/attachment/12867264/SENTRY-1759.001.patch 
against master.

{color:green}Overall:{color} +1 all checks pass

{color:green}SUCCESS:{color} all tests passed

Console output: 
https://builds.apache.org/job/PreCommit-SENTRY-Build/2666/console

This message is automatically generated.

> UpdatableCache leaks connections
> --------------------------------
>
>                 Key: SENTRY-1759
>                 URL: https://issues.apache.org/jira/browse/SENTRY-1759
>             Project: Sentry
>          Issue Type: Bug
>          Components: Sentry
>    Affects Versions: 1.8.0, sentry-ha-redesign
>            Reporter: Alexander Kolbasov
>            Assignee: Alexander Kolbasov
>            Priority: Critical
>         Attachments: SENTRY-1759.001.patch
>
>
> In UpdatableCache.loadFromRemote():
> {code}
>   private Table<String, String, Set<String>> loadFromRemote() throws 
> Exception {
>     Table<String, String, Set<String>> tempCache = HashBasedTable.create();
>     String requestor;
>     requestor = UserGroupInformation.getLoginUser().getShortUserName();
>     final SentryGenericServiceClient client = getClient(); // <-- Client 
> created
>     final Set<TSentryRole> tSentryRoles = client.listAllRoles(requestor, 
> componentType);
>     for (TSentryRole tSentryRole : tSentryRoles) {
>       final String roleName = tSentryRole.getRoleName();
>       final Set<TSentryPrivilege> tSentryPrivileges = 
> client.listPrivilegesByRoleName(requestor, roleName, componentType, 
> serviceName);
>       for (String group : tSentryRole.getGroups()) {
>         Set<String> currentPrivileges = tempCache.get(group, roleName);
>         if (currentPrivileges == null) {
>           currentPrivileges = new HashSet<>();
>           tempCache.put(group, roleName, currentPrivileges);
>         }
>         for (TSentryPrivilege tSentryPrivilege : tSentryPrivileges) {
>           
> currentPrivileges.add(tSentryPrivilegeConverter.toString(tSentryPrivilege));
>         }
>       }
>     }
>     return tempCache;
>   }
> {code}
> As you can see, the client is never closed, so on each timer iteration we are 
> leaking one connected client. This may quickly exhaust server connection 
> queue.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to