You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Tsz-wo Sze (Jira)" <ji...@apache.org> on 2020/04/20 18:19:00 UTC

[jira] [Updated] (RATIS-857) Thread unsafe RaftServerMetrics::metricsMap HashMap in multi thread

     [ https://issues.apache.org/jira/browse/RATIS-857?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tsz-wo Sze updated RATIS-857:
-----------------------------
    Component/s: metrics
        Summary: Thread unsafe RaftServerMetrics::metricsMap HashMap in multi thread  (was: Thread unsafe HashMap in multi thread)

> Thread unsafe RaftServerMetrics::metricsMap HashMap in multi thread
> -------------------------------------------------------------------
>
>                 Key: RATIS-857
>                 URL: https://issues.apache.org/jira/browse/RATIS-857
>             Project: Ratis
>          Issue Type: Bug
>          Components: metrics
>            Reporter: runzhiwang
>            Assignee: runzhiwang
>            Priority: Major
>         Attachments: RATIS-857.001.patch
>
>
> *What's the problem ?*
> The {color:#DE350B}static{color} variable [RaftServerMetrics::metricsMap|https://github.com/apache/incubator-ratis/blob/master/ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerMetrics.java#L71] is type of HashMap, which is not thread safe. But entry will be [put|https://github.com/apache/incubator-ratis/blob/master/ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerMetrics.java#L76] into metricsMap by different thread, when create each RaftServerImpl instance.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)