geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (GEODE-5314) MBeanStatsMonitor child classes should use atomics instead of volatiles to avoid data race
Date Thu, 02 Aug 2018 10:36:00 GMT

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

ASF GitHub Bot updated GEODE-5314:
----------------------------------
    Labels: pull-request-available  (was: )

> MBeanStatsMonitor child classes should use atomics instead of volatiles to avoid data
race
> ------------------------------------------------------------------------------------------
>
>                 Key: GEODE-5314
>                 URL: https://issues.apache.org/jira/browse/GEODE-5314
>             Project: Geode
>          Issue Type: Bug
>          Components: statistics
>            Reporter: Galen O'Sullivan
>            Assignee: Juan José Ramos Cassella
>            Priority: Major
>              Labels: pull-request-available
>
> {{GcStatsMonitor}} has the following:
> {code}
>   private volatile long collections = 0;
>   private volatile long collectionTime = 0;
> {code}
> <snip>
> {code}
>     collections -= statsMap.getOrDefault(StatsKey.VM_GC_STATS_COLLECTIONS,0).intValue();
>     collectionTime -= statsMap.getOrDefault(StatsKey.VM_GC_STATS_COLLECTION_TIME,0).intValue();
> {code}
> Because these are volatile and not atomic fields, there will be a race condition. Other
subclasses of {{MBeanStatsMonitor}} also use volatiles: AggregateRegionStatsMonitor, GatewaySenderOverflowMonitor,
MemberLevelDiskMonitor, VMStatsMonitor.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message