[
https://issues.apache.org/jira/browse/KAFKA-20064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18055454#comment-18055454
]
Chia-Ping Tsai edited comment on KAFKA-20064 at 1/30/26 3:55 PM:
-----------------------------------------------------------------
trunk:
[https://github.com/apache/kafka/commit/8209af2a23701c920e0eb9fe7933f6054d90edf0]
4.2:
https://github.com/apache/kafka/commit/cccf191c0c80b4b4e7f43f97358900fe5b12f5bd
4.1:
[https://github.com/apache/kafka/commit/299beee076c766a87bf536355e1c084e632f891f]
4.0: TBD
was (Author: chia7712):
trunk:
https://github.com/apache/kafka/commit/8209af2a23701c920e0eb9fe7933f6054d90edf0
4.2: TBD
4.1:
https://github.com/apache/kafka/commit/299beee076c766a87bf536355e1c084e632f891f
4.0: TBD
> A race condition in admin client can lead to the result future never being
> completed
> ------------------------------------------------------------------------------------
>
> Key: KAFKA-20064
> URL: https://issues.apache.org/jira/browse/KAFKA-20064
> Project: Kafka
> Issue Type: Bug
> Components: clients
> Affects Versions: 4.0.0
> Reporter: Nikita Shupletsov
> Assignee: Nikita Shupletsov
> Priority: Major
> Fix For: 4.3.0, 4.0.2, 4.1.2, 4.2.1
>
> Attachments: A_test_that_reproduces_the_issue.patch
>
>
> Here we make two independent calls that check the cache:
> [https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/admin/internals/AdminApiDriver.java#L118-L119]
> if the admin client is shared between multiple threads, there may be a
> situation when one request is initializing the AdminApiDriver, and the other
> one invalidates some values in the cache.
> E.g.:
> There are two partitions in the cache: 1,2. and two requests requesting
> offsets for both partitions.
> Thread1: calls uncachedLookupKeys, which returns an empty list, as both
> requested values are in the cache.
> Thread2: faced an issue with connecting to a node and invalidates the cache
> for partition 2.
> Thread1: calls cachedKeyBrokerIdMapping, which returns one 1.
> The future for partition 2 will never be completed, as we never created a
> request for it.
> An integration test that stages all these conditions and reproduces the issue
> is in the attachment
--
This message was sent by Atlassian Jira
(v8.20.10#820010)