Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.8.0, 2.0.0
    • Fix Version/s: 1.8.0, 2.0.0
    • Component/s: Sentry
    • Labels:
      None

      Description

      In UpdatableCache.loadFromRemote():

        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;
        }
      

      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.

        Attachments

        1. SENTRY-1759.001.patch
          3 kB
          Alexander Kolbasov

          Issue Links

            Activity

              People

              • Assignee:
                akolb Alexander Kolbasov
                Reporter:
                akolb Alexander Kolbasov
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: