chia7712 commented on a change in pull request #8657: URL: https://github.com/apache/kafka/pull/8657#discussion_r484138649
########## File path: core/src/test/scala/unit/kafka/coordinator/AbstractCoordinatorConcurrencyTest.scala ########## @@ -201,8 +201,8 @@ object AbstractCoordinatorConcurrencyTest { } } val producerRequestKeys = entriesPerPartition.keys.map(TopicPartitionOperationKey(_)).toSeq - watchKeys ++= producerRequestKeys producePurgatory.tryCompleteElseWatch(delayedProduce, producerRequestKeys) + watchKeys ++= producerRequestKeys Review comment: @junrao This approach can not resolve all potential deadlock. For example: 1. thread_a gets lock of op 1. thread_a adds op to watch list 1. thread_a calls op#tryComplete (and it requires lock_b) 1. thread_b holds lock_b 1. thread_b sees op from watch list 1. thread_b needs lock of op Hence, we are facing the following issues. 1. the last completion check can cause deadlock after the op is exposed to other threads (by watch list). 1. the last completion check can not be removed due to KAFKA-6653. How about using ActionQueue to resolve it? We add completion check to ActionQueue after adding op to watch list. All handlers are able to complete it even if they don't have same key. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org