You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Jose Armando Garcia Sancio (Jira)" <ji...@apache.org> on 2021/04/14 17:19:00 UTC

[jira] [Updated] (KAFKA-12668) MockScheduler is not safe to use in concurrent code.

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

Jose Armando Garcia Sancio updated KAFKA-12668:
-----------------------------------------------
    Labels: newbie  (was: )

> 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
>            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)