Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-8988

Optimize GMSMembership.getMembersNotShuttingDown() to return a static list of members

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments


    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.15.0
    • Fix Version/s: None
    • Component/s: membership
    • Labels:


      In GEODE-7245 PR review, Jake suggested this change in GMSMembership.getMembersNotShuttingDown() method:

      If the shutdownMembers list isn't changing frequently, like every ms, then repeatedly recreating the same set is just adding pressure to the GC and CPU time all while under a synchronized lock for no real gain. I assume this shutdownMembers list is updated with the member id of the member that has said it is or has gone down, which isn't a frequent event in production. Seems like we should be optimizing this method to be returning a rather static list of members known not to be shutting down even if that means the infrequent setting of a shutting down member takes a bit more time to handle, by copying lists and invalidating or updating the not shutdown servers list.


      The fix for GEODE-7245 replaces synchronized blocks around shutdownMembers list with read/write locks. In GMSMembership.getMembersNotShuttingDown() method, shutdownMembers list is used to create a new collection of members not shutting down.  This method is called for every p2p message sent, so the proposed change is a reasonable optimization.




            • Assignee:
              kaslami Kamilla Aslami


              • Created:

                Issue deployment