[ https://issues.apache.org/jira/browse/GEODE-10158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17514832#comment-17514832 ]
ASF subversion and git services commented on GEODE-10158: --------------------------------------------------------- Commit a887842575ee8d605bdb14c58b5713edbc05cf8d in geode's branch refs/heads/develop from Darrel Schneider [ https://gitbox.apache.org/repos/asf?p=geode.git;h=a887842 ] GEODE-10158: fix critical-offheap-threshold interaction with QueryMonitor (#7483) * Removed setQueryMonitorRequiredForResourceManager from InternalCache. Now when we are considering creating a QueryMonitor, the cache will ask the resource manager for its critical heap percentage. If it is 0 then it the resource manager does not need a QueryMonitor for low mem monitoring. Also optimized MemoryMonitor.getThresholds to not make a copy of the result since MemoryThresholds is immutable. * added unit test coverage for changes to getQueryMonitor also cleaned up old warnings in GemFireCacheImplTest * added unit test that proves getQueryMonitor now ignores the critical offheap setting > offheap can incorrectly disable or enable the query monitor > ------------------------------------------------------------ > > Key: GEODE-10158 > URL: https://issues.apache.org/jira/browse/GEODE-10158 > Project: Geode > Issue Type: Bug > Components: offheap, querying > Reporter: Darrel Schneider > Assignee: Darrel Schneider > Priority: Major > Labels: pull-request-available > Fix For: 1.15.0 > > > Geode has a QueryMonitor that should be disabled if the resource manager's > critical-heap-threshold is 0 and enabled if it is > 0. > But critical-offheap-threshold tries to also disable and enable the > QueryMonitor. I think this is wrong since queries do not consume off-heap > memory. QueryMonitor's relationship with the ResourceManager should only care > about the critical-heap-threshold. The biggest risk is that this bug could > cause the QueryMonitor to be disabled even though critical-heap-threshold is > > 0. This would allow queries to consume heap memory when instead they should > have failed with a LowMemoryException. > To workaround this issue make sure that if you are using offheap that you > either leave both critical thresholds set to 0 or set both of them to a > non-zero value. > A simple fix for this exists. Delete this one line from OffHeapMemoryMonitor: > cache.setQueryMonitorRequiredForResourceManager(criticalThreshold != 0); > A better fix would be to remove the > InternalCache.setQueryMonitorRequiredForResourceManager method and instead > have GemFireCacheImpl.getQueryMonitor method ask it's InternalResourceManager > if it requires a QueryMonitor. -- This message was sent by Atlassian Jira (v8.20.1#820001)