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/02/16 11:23:10 UTC

[GitHub] [pulsar] WJL3333 opened a new pull request #9596: [Issue #9595] Make local policies immutable to avoid concurrent modify problem

WJL3333 opened a new pull request #9596:
URL: https://github.com/apache/pulsar/pull/9596


   Fixes #9595
   
   ### Motivation
   
   make `LocalPolicies` immutable to avoid concurrent modify inconsistent.
   
   `NamespaceService.updateNamespaceBundles` is not thread safe.
   when split the same namespace concurrently,
   both 2 thread can get the same `LocalPolicies` instance from pulsar.getLocalZkCacheService().policiesCache()
   
   and `updateNamespaceBundles` change the LocalPolicies.bundles without
   concurrent protect. which can cause the param `NamespaceBundles` is inconsistent with the serialized data.
   
   ### Modifications
   
   make `LocalPolicies` immutable. each time modify field need object copy to avoid change the same instance concurrently.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change is already covered by existing tests, such as *V1_AdminApiTest.testNamespaceSplitBundleConcurrent*.
   
   ### Does this pull request potentially affect one of the following parts:
   
   no 
   
   ### Documentation
   
   no


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] WJL3333 closed pull request #9596: [Issue #9595] Make local policies immutable to avoid concurrent modify problem

Posted by GitBox <gi...@apache.org>.
WJL3333 closed pull request #9596:
URL: https://github.com/apache/pulsar/pull/9596


   


----------------------------------------------------------------
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:
users@infra.apache.org