chia7712 commented on code in PR #22759:
URL: https://github.com/apache/kafka/pull/22759#discussion_r4644054014


##########
clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/secured/VerificationKeyResolverFactory.java:
##########
@@ -180,8 +189,12 @@ public void configure(Map<String, ?> configs, String 
saslMechanism, List<AppConf
 
         @Override
         public void close() throws IOException {
-            if (count.decrementAndGet() == 0)
+            if (count.decrementAndGet() == 0) {
+                // Drop the cache entry so that a later get() with the same 
configuration builds a new
+                // resolver rather than resurrecting this closed one.
+                remove(cacheKey);

Review Comment:
   `count` is not updated under the lock of `VerificationKeyResolverFactory`, 
so remove could drop a newer entry and delegate.close could close a resolver 
that another caller just got from get :(



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to