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/08/13 02:43:27 UTC

[GitHub] [pulsar] Technoboy- opened a new pull request #11656: Use getIfValid to avoid handleMetadataStoreNotification swallow exception

Technoboy- opened a new pull request #11656:
URL: https://github.com/apache/pulsar/pull/11656


   ### Motivation
   getNamespaceFromPoliciesPath(n.getPath()) may return empty, and result NamespaceName.get throw IllegalArgumentException
   
   ### Documentation
   
   This is code-optimized, no need to update the doc.
   
   
   
   
   


-- 
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] eolivelli commented on a change in pull request #11656: Use getIfValid to avoid handleMetadataStoreNotification swallow exception

Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #11656:
URL: https://github.com/apache/pulsar/pull/11656#discussion_r688291510



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/common/naming/NamespaceBundleFactory.java
##########
@@ -159,14 +159,16 @@ private NamespaceBundles readBundles(NamespaceName namespace, byte[] value, long
 
     private void handleMetadataStoreNotification(Notification n) {
         if (n.getPath().startsWith(LOCAL_POLICIES_ROOT)) {
-            final NamespaceName namespace = NamespaceName.get(getNamespaceFromPoliciesPath(n.getPath()));

Review comment:
       here, aren't we expecting some well known path ?
   how this is possible ?




-- 
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] Technoboy- commented on a change in pull request #11656: Use getIfValid to avoid handleMetadataStoreNotification swallow exception

Posted by GitBox <gi...@apache.org>.
Technoboy- commented on a change in pull request #11656:
URL: https://github.com/apache/pulsar/pull/11656#discussion_r688363676



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/common/naming/NamespaceBundleFactory.java
##########
@@ -159,14 +159,16 @@ private NamespaceBundles readBundles(NamespaceName namespace, byte[] value, long
 
     private void handleMetadataStoreNotification(Notification n) {
         if (n.getPath().startsWith(LOCAL_POLICIES_ROOT)) {
-            final NamespaceName namespace = NamespaceName.get(getNamespaceFromPoliciesPath(n.getPath()));

Review comment:
       n.getPath() may return "/admin/local-policies" or "/admin/local-policies/aaa" that not satisfied with 6 slashes.
   getNamespaceFromPoliciesPath(n.getPath()) may return "".  and cause NamespaceName.get() throw IllegalArgumentException.




-- 
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 #11656: Use getIfValid to avoid handleMetadataStoreNotification swallow exception

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


   


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