kafka-jira mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "huxihx (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KAFKA-6341) 'networkThreadTimeNanos' in KafkaChannel is not thread safe
Date Tue, 12 Dec 2017 00:27:00 GMT

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

huxihx commented on KAFKA-6341:
-------------------------------

[~ijuma] Thanks for reminding. I forget the fact that each Processor thread creates its own
Selector instance which wraps a KafkaChannel instance. Closing this jira since it's not a
problem.

> '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)

Mime
View raw message