geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GEODE-488) OffHeapMemoryMonitor deliverNextAbnormalEvent logic needs review
Date Thu, 19 Nov 2015 22:40:11 GMT

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

ASF subversion and git services commented on GEODE-488:
-------------------------------------------------------

Commit 59ab8cf5aef00dddb9587ae9b7964de277630d35 in incubator-geode's branch refs/heads/develop
from [~dschneider]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-geode.git;h=59ab8cf ]

GEODE-438: fix race in OffHeapMemoryMonitor
This fix also fixes GEODE-488 and GEODE-551.
Also fixed test to use standard locators for connectivity
instead of an mcast-port.


> OffHeapMemoryMonitor deliverNextAbnormalEvent logic needs review
> ----------------------------------------------------------------
>
>                 Key: GEODE-488
>                 URL: https://issues.apache.org/jira/browse/GEODE-488
>             Project: Geode
>          Issue Type: Task
>            Reporter: Darrel Schneider
>            Assignee: Darrel Schneider
>
> OffHeapMemoryMonitor deliverNextAbnormalEvent logic needs review.
> It looks like we set it to true but then don't call updateStateAndSendEvent which is
the only code that uses it.
> It only uses it if the amount of off-heap memory has changed.
> The original intent of it was to deliver an event if the amount of memory has changed
but the non-normal state has not.
> This code might be ok; it just needs review.
> {code}
>       while (!this.stopRequested) {
>         updateStateAndSendEvent(lastOffHeapMemoryUsed);
>         synchronized (this) {
>           if (lastOffHeapMemoryUsed == this.offHeapMemoryUsed && !this.stopRequested)
{
>             try {
>               do {
>                 this.wait(1000);
>                 if (this.offHeapMemoryUsed == lastOffHeapMemoryUsed) {
>                   // The wait timed out. So tell the OffHeapMemoryMonitor
>                   // that we need an event if the state is not normal.
>                   deliverNextAbnormalEvent();
>                   // TODO: don't we need a "break" here?
>                   //       As it is we set deliverNextAbnormalEvent
>                   //       but then go back to sleep in wait.
>                   //       We need to call updateStateAndSendEvent
>                   //       which tests deliverNextAbnormalEvent.
>                   // But just adding a break is probably not enough.
>                   // We only set deliverNextAbnormalEvent if the wait
>                   // timed out which means that the amount of offHeapMemoryUsed
>                   // did not change.
>                   // But in updateStateAndSendEvent we only deliver an
>                   // abnormal event if the amount of memory changed.
>                   // This code needs to be reviewed with Swapnil but
>                   // it looks to Darrel like deliverNextAbnormalEvent
>                   // can be removed.
>                 } else {
>                   // we have been notified so exit the inner while loop
>                   // and call updateStateAndSendEvent.
>                   lastOffHeapMemoryUsed = this.offHeapMemoryUsed;
>                   break;
>                 }
>               } while (true);
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message