[ https://issues.apache.org/jira/browse/KAFKA-4994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15983594#comment-15983594 ]
ASF GitHub Bot commented on KAFKA-4994: --------------------------------------- GitHub user johnma14 opened a pull request: https://github.com/apache/kafka/pull/2914 KAFKA-4994: Fix findbug warnings about OffsetStorageWriter OffsetStorageWriter is not a thread-safe class and should be accessed only from a Task's processing thread. The WorkerSourceTask class calls the different methods (offset, beginFlush, cancelFlush, handleFinishWrite) within a synchronized block. Hence the method definitions in OffsetStorageWriter.java does not need to contain the keyword synchronized again. In the OffsetStorageWriter.java class, the doFlush() method is not explicitely synchronized like the other methods in this class. Hence this can lead to inconsistent synchronization of variables like currentFlushId and toFlush which are set in the synchronized methods within this class. - https://github.com/apache/kafka/blob/trunk/connect/runtime/src/main/java/org/apache/kafka/connect/storage/OffsetStorageWriter.java - https://github.com/apache/kafka/blob/trunk/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSourceTask.java#L295 You can merge this pull request into a Git repository by running: $ git pull https://github.com/johnma14/kafka bug/kafka-4994 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/2914.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 #2914 ---- commit d481c10818b59e67eaac0aa598e845773b07e51d Author: Mariam John <mari...@us.ibm.com> Date: 2017-04-25T20:47:04Z KAFKA-4994: Fix findbug warnings about OffsetStorageWriter OffsetStorageWriter is not a thread-safe class and should be accessed only from a Task's processing thread. The WorkerSourceTask class calls the different methods (offset, beginFlush, cancelFlush, handleFinishWrite) within a synchronized block. Hence the method definitions in OffsetStorageWriter.java does not need to contain the keyword synchronized again. ---- > Fix findbugs warning about OffsetStorageWriter#currentFlushId > ------------------------------------------------------------- > > Key: KAFKA-4994 > URL: https://issues.apache.org/jira/browse/KAFKA-4994 > Project: Kafka > Issue Type: Bug > Reporter: Colin P. McCabe > Assignee: Mariam John > Labels: newbie > > We should fix the findbugs warning about > {{OffsetStorageWriter#currentFlushId}} > {code} > Multithreaded correctness Warnings > IS2_INCONSISTENT_SYNC: Inconsistent synchronization of > org.apache.kafka.connect.storage.OffsetStorageWriter.currentFlushId; locked > 83% of time > IS2_INCONSISTENT_SYNC: Inconsistent synchronization of > org.apache.kafka.connect.storage.OffsetStorageWriter.toFlush; locked 75% of > time > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)