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

ASF GitHub Bot commented on GEODE-8491:
---------------------------------------

boglesby commented on a change in pull request #5509:
URL: https://github.com/apache/geode/pull/5509#discussion_r489081453



##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySender.java
##########
@@ -1118,6 +1115,17 @@ public void distribute(EnumListenerEvent operation, 
EntryEventImpl event,
     }
   }
 
+  private void recordDroppedEvent(EntryEventImpl event) {
+    if (this.eventProcessor != null) {
+      this.eventProcessor.registerEventDroppedInPrimaryQueue(event);

Review comment:
       In 
ConcurrentParallelGatewaySenderEventProcessor.registerEventDroppedInPrimaryQueue
 instead of calling sendQueueRemovalMesssageForDroppedEvent to send a 
ParallelQueueRemovalMessage inline, can you call 
ParallelGatewaySenderQueue.addRemovedEvent and let the BatchRemovalThread 
handle sending the message?
   
   Something like:
   ```
   ...
   int bucketId = PartitionedRegionHelper.getHashKey((EntryOperation) 
droppedEvent);
   boolean isPrimary = 
prQ.getRegionAdvisor().getBucketAdvisor(bucketId).isPrimary();
   if (isPrimary) {
     long shadowKey = droppedEvent.getTailKey();
     ParallelGatewaySenderQueue pgsq = (ParallelGatewaySenderQueue) 
cpgsq.getQueueByBucket(bucketId);
     pgsq.addRemovedEvent(prQ, bucketId, shadowKey);
     this.sender.getStatistics().incEventsDroppedDueToPrimarySenderNotRunning();
   ...
   ``
   I didn't try this, but it seems like it should work.
   
   I'm not sure if the same idea would work for 
SerialGatewaySenderEventProcessor.sendBatchDestroyOperationForDroppedEvent 
since it has a different implementation.
   
   btw - sendQueueRemovalMesssageForDroppedEvent has an extra 's'.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Events received when gateway sender is stopped use heap memory
> --------------------------------------------------------------
>
>                 Key: GEODE-8491
>                 URL: https://issues.apache.org/jira/browse/GEODE-8491
>             Project: Geode
>          Issue Type: Bug
>          Components: wan
>    Affects Versions: 1.7.0, 1.8.0, 1.9.0, 1.9.1, 1.10.0, 1.9.2, 1.11.0, 
> 1.12.0, 1.13.0
>            Reporter: Alberto Gomez
>            Assignee: Alberto Gomez
>            Priority: Major
>              Labels: pull-request-available
>
> When a gateway sender is stopped, events received are stored in a member 
> variable of the sender (tmpDroppedEvents) to be later sent to secondary 
> gateway senders to remove these dropped events from their queues.
> This events use heap memory from the member and could eventually fill up the 
> available memory.
> See RFC 
> [https://cwiki.apache.org/confluence/display/GEODE/Avoid+the+queuing+of+dropped+events+by+the+primary+gateway+sender+when+the+gateway+sender+is+stopped]
>  



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

Reply via email to