mumrah commented on code in PR #12628: URL: https://github.com/apache/kafka/pull/12628#discussion_r969006371
########## metadata/src/main/java/org/apache/kafka/metadata/authorizer/StandardAuthorizerData.java: ########## @@ -534,49 +535,19 @@ Iterable<AclBinding> acls(AclBindingFilter filter) { } class AclIterable implements Iterable<AclBinding> { - private final AclBindingFilter filter; + private final List<AclBinding> aclBindingList; AclIterable(AclBindingFilter filter) { - this.filter = filter; + this.aclBindingList = aclsByResource Review Comment: Just to clarify my understanding. Previously, we were wrapping the aclsByResource iterator. This was intended to be thread-safe, but as you mentioned offline, there was no guard against the underlying map getting modified during iteration (since the ConcurrentSkipListMap might show updated elements to the iterator). Instead, we are now making a copy of the matching AclBinding and returning that's lists iterator the caller. So, basically trading off memory for consistency. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org