[ https://issues.apache.org/jira/browse/RATIS-857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17086823#comment-17086823 ]
runzhiwang commented on RATIS-857: ---------------------------------- [~ljain] Could you help review this patch ? Thank you very much. > Thread unsafe HashMap in multi thread > ------------------------------------- > > Key: RATIS-857 > URL: https://issues.apache.org/jira/browse/RATIS-857 > Project: Ratis > Issue Type: Bug > Reporter: runzhiwang > Assignee: runzhiwang > Priority: Major > Attachments: RATIS-857.001.patch > > > *What's the problem ?* > The static 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)