You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "huxihx (JIRA)" <ji...@apache.org> on 2017/12/11 09:09:00 UTC

[jira] [Created] (KAFKA-6341) 'networkThreadTimeNanos' in KafkaChannel is not thread safe

huxihx created KAFKA-6341:
-----------------------------

             Summary: 'networkThreadTimeNanos' in KafkaChannel is not thread safe
                 Key: KAFKA-6341
                 URL: https://issues.apache.org/jira/browse/KAFKA-6341
             Project: Kafka
          Issue Type: Bug
          Components: metrics
    Affects Versions: 1.0.0
            Reporter: huxihx


`networkThreadTimeNanos` in KafkaChannel is of primitive long type which is not thread safe. Multiple Processor threads could access(read and write) this variable at the same time. Since JVM spec does not guarantee of the atomic 64-bit operations against long/double types, it's safer to employ AtomicLong instead of the naive long type.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)