[ 
https://issues.apache.org/jira/browse/KAFKA-9632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17051045#comment-17051045
 ] 

ASF GitHub Bot commented on KAFKA-9632:
---------------------------------------

rajinisivaram commented on pull request #8209: KAFKA-9632; Fix MockScheduler 
synchronization for safe use in Log/Partition tests
URL: https://github.com/apache/kafka/pull/8209
 
 
   
 
----------------------------------------------------------------
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


> Transient test failure: PartitionLockTest.testAppendReplicaFetchWithUpdateIsr
> -----------------------------------------------------------------------------
>
>                 Key: KAFKA-9632
>                 URL: https://issues.apache.org/jira/browse/KAFKA-9632
>             Project: Kafka
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.5.0
>            Reporter: Rajini Sivaram
>            Assignee: Rajini Sivaram
>            Priority: Major
>
> When running this test with _numRecordsPerProducer=500_, the test fails 
> intermittently. The test uses MockTime and runs concurrent log operations. 
> This can cause issues when attempting to roll a segment since Log and 
> MockScheduler don't work well together. MockScheduler currently runs tasks 
> while holding the MockScheduler lock. This can cause a deadlock if a thread 
> attempts to schedule a task while holding a lock which is also acquired 
> within a scheduled task.
> The issue in this test occurs when these two operations happen concurrently:
> 1) LogManager.cleanupLogs is a scheduled task that acquires Log lock. When 
> run with MockScheduler, the thread holds MockScheduler lock and then attempts 
> to acquire Log lock.
> 2) Partition.appendLogsToLeader holds Log lock and attempts to acquire 
> MockScheduler lock in order to schedule a roll().
> Since locking order is reversed in 1) and 2), this causes a deadlock.
> The test itself can be easily fixed by avoiding roll() in the test. But it 
> will be good to fix MockScheduler to enable it to be used in this case.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to