[ https://issues.apache.org/jira/browse/KAFKA-12668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17352476#comment-17352476 ]
Maksim Iakunin edited comment on KAFKA-12668 at 5/27/21, 1:29 PM: ------------------------------------------------------------------ GitHub pull-request with bug-fix: https://github.com/apache/kafka/pull/10775 [~jagsancio], could you have a look, please? was (Author: iakunin): GitHub pull-request: https://github.com/apache/kafka/pull/10775 > MockScheduler is not safe to use in concurrent code. > ---------------------------------------------------- > > Key: KAFKA-12668 > URL: https://issues.apache.org/jira/browse/KAFKA-12668 > Project: Kafka > Issue Type: Improvement > Components: unit tests > Reporter: Jose Armando Garcia Sancio > Assignee: Maksim Iakunin > Priority: Major > Labels: newbie > > The current implementation of {{MockScheduler}} executes tasks in the same > stack when {{schedule}} is called. This violates {{Log}}'s assumption since > {{Log}} calls {{schedule}} while holding a lock. This can cause deadlock in > tests. > One solution is to change {{MockSchedule}} {{schedule}} method so that > {{tick}} is not called. {{tick}} should be called by a stack (thread) that > doesn't hold any locks. -- This message was sent by Atlassian Jira (v8.3.4#803005)