You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Abhinav Dixit (Jira)" <ji...@apache.org> on 2024/12/05 10:41:00 UTC

[jira] [Updated] (KAFKA-18129) `SharePartition#maybeInitialize` should complete the future outsize the write lock

     [ https://issues.apache.org/jira/browse/KAFKA-18129?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Abhinav Dixit updated KAFKA-18129:
----------------------------------
    Summary: `SharePartition#maybeInitialize` should complete the future outsize the write lock  (was: `SharePartition#maybeInitialize` doesn't obtain write lock to complete the initialization post persister read)

> `SharePartition#maybeInitialize` should complete the future outsize the write lock
> ----------------------------------------------------------------------------------
>
>                 Key: KAFKA-18129
>                 URL: https://issues.apache.org/jira/browse/KAFKA-18129
>             Project: Kafka
>          Issue Type: Sub-task
>            Reporter: Abhinav Dixit
>            Assignee: Abhinav Dixit
>            Priority: Major
>
> In reference to comment [https://github.com/apache/kafka/pull/17957#discussion_r1862570482] ,
> It might be better not to complete the future while holding the write lock. The registered action for the {{future}} could potentially try to acquire another lock that is held by a different thread, which, in turn, could be waiting on the write lock - resulting in a deadlock.
> In short, I prefer to narrow the scope of the write lock to avoid potential deadlock issues.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)