GitHub user johnma14 opened a pull request: https://github.com/apache/kafka/pull/2913
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 Closes bug: Kafka-4994 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/2913.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 #2913 ---- ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---