[ https://issues.apache.org/jira/browse/KAFKA-2859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15012010#comment-15012010 ]
ASF GitHub Bot commented on KAFKA-2859: --------------------------------------- GitHub user ewencp opened a pull request: https://github.com/apache/kafka/pull/554 KAFKA-2859: Fix deadlock in WorkerSourceTask. You can merge this pull request into a Git repository by running: $ git pull https://github.com/ewencp/kafka kafka-2859-deadlock-worker-source-task Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/554.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #554 ---- commit 30ae78f2e58a56319b7d173c6e308e9c37214eee Author: Ewen Cheslack-Postava <m...@ewencp.org> Date: 2015-11-18T19:38:29Z KAFKA-2859: Fix deadlock in WorkerSourceTask. ---- > Deadlock in WorkerSourceTask > ---------------------------- > > Key: KAFKA-2859 > URL: https://issues.apache.org/jira/browse/KAFKA-2859 > Project: Kafka > Issue Type: Bug > Components: copycat > Reporter: Ewen Cheslack-Postava > Assignee: Ewen Cheslack-Postava > Priority: Blocker > Fix For: 0.9.0.0 > > > There is a potential deadlock due to synchronization used around both the > producer.send() and in the produce callback in WorkerSourceTask. This can be > triggered, for example, if: > 1. WorkerSourceTask work thread is running sendRecords and therefore owns the > lock on itself, then invokes producer.send() and needs a metadata update > (sending to a new topic), which causes it to wait on the Metadata class, > which is notified by the Sender thread when it has updated metadata. > 2. Sender thread is processing a message completion, invokes the callback in > WorkerSourceTask, which then tries to invoke recordSent, which needs to > acquire the WorkerSourceTask lock. It will wait on this lock and never > process the metadata update request, so the other thread will never proceed > either. -- This message was sent by Atlassian JIRA (v6.3.4#6332)