You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/09/28 17:40:44 UTC

[GitHub] [pulsar] michaeljmarshall opened a new pull request #12228: [Java Client] Remove unnecessary synchronization; Simplify initialization

michaeljmarshall opened a new pull request #12228:
URL: https://github.com/apache/pulsar/pull/12228


   ### Motivation
   
   In https://github.com/apache/pulsar/pull/8051, the `producers` and `consumers` sets in the `PulsarClientImpl` were updated to be backed by a concurrent hash map. Therefore, there is no need to synchronize updates to the map or the counting of the size of the map.
   
   This update will help improve shutdown times when there are many producers/consumers.
   
   ### Modifications
   
   * Update `cleanupProducer` and `cleanupConsumer` to remove the unnecessary `synchronize` on each set update
   * Update `producersCount` and `consumersCount` to remove the unnecessary `synchronize` on each set count
   * Update the initialization of each set to make it clear that these sets are intentionally thread safe data structures
   
   ### Verifying this change
   
   This is a trivial change. Since we switched to a concurrent data structure in this PR, https://github.com/apache/pulsar/pull/8051, it is safe to remove the `synchronize` blocks around the set updates. It is also safe to assume that getting the count of elements in the set will be the "latest" number of elements.
   
   ### Does this pull request potentially affect one of the following parts:
   
   This change does not affect any public behavior. It should improve shutdown time of the Java client in cases where there are many producers or consumers.
   
   ### Documentation
   
   This is a change to an implementation detail within the client. There is no need to update documentation.


-- 
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: commits-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] michaeljmarshall commented on pull request #12228: [Java Client] Remove unnecessary synchronization; Simplify initialization

Posted by GitBox <gi...@apache.org>.
michaeljmarshall commented on pull request #12228:
URL: https://github.com/apache/pulsar/pull/12228#issuecomment-929637483


   /pulsarbot run-failure-checks


-- 
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: commits-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] merlimat merged pull request #12228: [Java Client] Remove unnecessary synchronization; Simplify initialization

Posted by GitBox <gi...@apache.org>.
merlimat merged pull request #12228:
URL: https://github.com/apache/pulsar/pull/12228


   


-- 
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: commits-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] michaeljmarshall commented on pull request #12228: [Java Client] Remove unnecessary synchronization; Simplify initialization

Posted by GitBox <gi...@apache.org>.
michaeljmarshall commented on pull request #12228:
URL: https://github.com/apache/pulsar/pull/12228#issuecomment-929581587


   /pulsarbot run-failure-checks


-- 
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: commits-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] michaeljmarshall commented on pull request #12228: [Java Client] Remove unnecessary synchronization; Simplify initialization

Posted by GitBox <gi...@apache.org>.
michaeljmarshall commented on pull request #12228:
URL: https://github.com/apache/pulsar/pull/12228#issuecomment-929481629


   @Technoboy- - PTAL


-- 
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: commits-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] michaeljmarshall commented on pull request #12228: [Java Client] Remove unnecessary synchronization; Simplify initialization

Posted by GitBox <gi...@apache.org>.
michaeljmarshall commented on pull request #12228:
URL: https://github.com/apache/pulsar/pull/12228#issuecomment-929481629


   @Technoboy- - PTAL


-- 
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: commits-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] michaeljmarshall commented on pull request #12228: [Java Client] Remove unnecessary synchronization; Simplify initialization

Posted by GitBox <gi...@apache.org>.
michaeljmarshall commented on pull request #12228:
URL: https://github.com/apache/pulsar/pull/12228#issuecomment-929637483


   /pulsarbot run-failure-checks


-- 
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: commits-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] merlimat merged pull request #12228: [Java Client] Remove unnecessary synchronization; Simplify initialization

Posted by GitBox <gi...@apache.org>.
merlimat merged pull request #12228:
URL: https://github.com/apache/pulsar/pull/12228


   


-- 
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: commits-unsubscribe@pulsar.apache.org

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