You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/05/24 05:35:05 UTC

[jira] [Commented] (KAFKA-5147) KafkaProducer's TransactionManager needs a review on synchronization

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

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

GitHub user apurvam opened a pull request:

    https://github.com/apache/kafka/pull/3132

    KAFKA-5147: Add missing synchronization to TransactionManager

    The basic idea is that exactly three collections, ie. `pendingRequests`, `newPartitionsToBeAddedToTransaction`, and `partitionsInTransaction` are accessed from the context of application threads. The first two are modified from the application threads, and the last is read from those threads. 
    
    So to make the `TransactionManager` truly thread safe, we have to ensure that all accesses to these three members are done in a synchronized block. I inspected the code, and I believe this patch puts the synchronization in all the correct places.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apurvam/kafka KAFKA-5147-transaction-manager-synchronization-fixes

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/kafka/pull/3132.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 #3132
    
----
commit 9c869396d09712ebc76ef03c55507cd099b47914
Author: Apurva Mehta <ap...@confluent.io>
Date:   2017-05-24T05:28:15Z

    Add missing synchronization to TransactionManager

----


> KafkaProducer's TransactionManager needs a review on synchronization
> --------------------------------------------------------------------
>
>                 Key: KAFKA-5147
>                 URL: https://issues.apache.org/jira/browse/KAFKA-5147
>             Project: Kafka
>          Issue Type: Sub-task
>            Reporter: Apurva Mehta
>            Assignee: Apurva Mehta
>            Priority: Blocker
>              Labels: exactly-once
>             Fix For: 0.11.0.0
>
>
> Currently, the completion handlers are not synchronized, though they access shared state like `partitionsInTransaction`, and `lastError`, `pendingPartitionsToBeaddedToTransaction`, etc. 
> We should either make the collections concurrent or synchronize the handlers. 
> In general, we need to review this code to ensure that the synchronization is correct. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)