You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2022/04/27 17:30:53 UTC

[GitHub] [geode] jinmeiliao commented on a diff in pull request #7628: GEODE-10260: make sure message is added before they are processed.

jinmeiliao commented on code in PR #7628:
URL: https://github.com/apache/geode/pull/7628#discussion_r860076671


##########
geode-core/src/main/java/org/apache/geode/internal/cache/FilterProfile.java:
##########
@@ -1846,18 +1846,27 @@ protected void process(ClusterDistributionManager dm) {
         }
 
         CacheDistributionAdvisor cda = (CacheDistributionAdvisor) r.getDistributionAdvisor();
-        CacheDistributionAdvisor.CacheProfile cp =
-            (CacheDistributionAdvisor.CacheProfile) cda.getProfile(getSender());
-        if (cp == null) { // PR accessors do not keep filter profiles around
-          if (logger.isDebugEnabled()) {
-            logger.debug(
-                "No cache profile to update, adding filter profile message to queue. Message :{}",
-                this);
+        CacheDistributionAdvisor.CacheProfile cp;
+
+        // prevent adding the message to queue after we have processed the queue
+        // in CreateRegionReplyProcessor.process
+        synchronized (cda) {

Review Comment:
   If the CreateRegionMessageReply is processed before the lock is acquired (more precisely, if the putProfile call is processed inside the `process` method), then the if(pf==null) will return false, so the register_cq message will not be put in the queue, but to be processed regularly.



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

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