kafka-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KAFKA-5147) KafkaProducer's TransactionManager needs a review on synchronization
Date Wed, 24 May 2017 05:35:05 GMT

    [ 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:


    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:


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 <apurva@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:
> Currently, the completion handlers are not synchronized, though they access shared state
like `partitionsInTransaction`, and `lastError`, `pendingPartitionsToBeaddedToTransaction`,
> 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

View raw message