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 2022/12/09 10:02:02 UTC

[GitHub] [pulsar] nodece opened a new pull request, #18837: [fix][broker] ignore the exception of creating namespace

nodece opened a new pull request, #18837:
URL: https://github.com/apache/pulsar/pull/18837

   ### Motivation
   
   In the standalone model, when the `admin` client hasn't permission to create the namespace, the Pulsar will exit.
   
   Keep the same logic with branch-2.10.
   
   https://github.com/apache/pulsar/blob/branch-2.10/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java#L409-L414
   
   ### Modifications
   
   Add `try...catch` wrappe.
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. Please attach the local preview screenshots (run `sh start.sh` at `pulsar/site2/website`) to your PR description, or else your PR might not get merged. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: <!-- ENTER URL HERE -->
   
   <!--
   After opening this PR, the build in apache/pulsar will fail and instructions will
   be provided for opening a PR in the PR author's forked repository.
   
   apache/pulsar pull requests should be first tested in your own fork since the 
   apache/pulsar CI based on GitHub Actions has constrained resources and quota.
   GitHub Actions provides separate quota for pull requests that are executed in 
   a forked repository.
   
   The tests will be run in the forked repository until all PR review comments have
   been handled, the tests pass and the PR is approved by a reviewer.
   -->
   


-- 
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- closed pull request #18837: [fix][broker] Ignore the exception of creating namespace

Posted by GitBox <gi...@apache.org>.
Technoboy- closed pull request #18837: [fix][broker] Ignore the exception of creating namespace
URL: https://github.com/apache/pulsar/pull/18837


-- 
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] nodece commented on a diff in pull request #18837: [fix][broker] ignore the exception of creating namespace

Posted by GitBox <gi...@apache.org>.
nodece commented on code in PR #18837:
URL: https://github.com/apache/pulsar/pull/18837#discussion_r1044305304


##########
pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java:
##########
@@ -393,7 +393,11 @@ void createNameSpace(String cluster, String publicTenant, NamespaceName ns) thro
         }
 
         if (!nsr.namespaceExists(ns)) {
-            broker.getAdminClient().namespaces().createNamespace(ns.toString());
+            try {
+                broker.getAdminClient().namespaces().createNamespace(ns.toString());
+            } catch (Exception e) {
+                log.warn(e.getMessage());

Review Comment:
   When the authentication/authorization is enabled, we should configure the `brokerClientAuthenticationPlugin` and `brokerClientAuthenticationParameters`.
   
   To avoid breaking change, so I made this PR.



-- 
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- merged pull request #18837: [fix][broker] Ignore the exception of creating namespace

Posted by GitBox <gi...@apache.org>.
Technoboy- merged PR #18837:
URL: https://github.com/apache/pulsar/pull/18837


-- 
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] tisonkun commented on a diff in pull request #18837: [fix][broker] ignore the exception of creating namespace

Posted by GitBox <gi...@apache.org>.
tisonkun commented on code in PR #18837:
URL: https://github.com/apache/pulsar/pull/18837#discussion_r1044287541


##########
pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java:
##########
@@ -393,7 +393,11 @@ void createNameSpace(String cluster, String publicTenant, NamespaceName ns) thro
         }
 
         if (!nsr.namespaceExists(ns)) {
-            broker.getAdminClient().namespaces().createNamespace(ns.toString());
+            try {
+                broker.getAdminClient().namespaces().createNamespace(ns.toString());
+            } catch (Exception e) {
+                log.warn(e.getMessage());

Review Comment:
   ```suggestion
                   log.warn("...", e);
   ```
   
   Besides, if the default manner to start a standalone cluster falls back to this branch, how can a standalone cluster successfully create the namespace (with what extra configs)?



-- 
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] tisonkun commented on a diff in pull request #18837: [fix][broker] ignore the exception of creating namespace

Posted by GitBox <gi...@apache.org>.
tisonkun commented on code in PR #18837:
URL: https://github.com/apache/pulsar/pull/18837#discussion_r1044287541


##########
pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java:
##########
@@ -393,7 +393,11 @@ void createNameSpace(String cluster, String publicTenant, NamespaceName ns) thro
         }
 
         if (!nsr.namespaceExists(ns)) {
-            broker.getAdminClient().namespaces().createNamespace(ns.toString());
+            try {
+                broker.getAdminClient().namespaces().createNamespace(ns.toString());
+            } catch (Exception e) {
+                log.warn(e.getMessage());

Review Comment:
   ```suggestion
                   log.warn("...", e);
   ```
   
   Besides, if the default manner to start a standalone cluster falls back to this branch, how can a standalone cluster successfully create the namespace (with which extra configs)?



-- 
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] codecov-commenter commented on pull request #18837: [fix][broker] Ignore the exception of creating namespace

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #18837:
URL: https://github.com/apache/pulsar/pull/18837#issuecomment-1346019846

   # [Codecov](https://codecov.io/gh/apache/pulsar/pull/18837?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18837](https://codecov.io/gh/apache/pulsar/pull/18837?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (410ca5f) into [master](https://codecov.io/gh/apache/pulsar/commit/3180a4aa04d518fa401a781d646545221c4d1fa6?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3180a4a) will **decrease** coverage by `9.07%`.
   > The diff coverage is `0.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/pulsar/pull/18837/graphs/tree.svg?width=650&height=150&src=pr&token=acYqCpsK9J&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/pulsar/pull/18837?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #18837      +/-   ##
   ============================================
   - Coverage     46.17%   37.09%   -9.08%     
   + Complexity    10359     1970    -8389     
   ============================================
     Files           703      209     -494     
     Lines         68845    14431   -54414     
     Branches       7382     1574    -5808     
   ============================================
   - Hits          31788     5353   -26435     
   + Misses        33448     8493   -24955     
   + Partials       3609      585    -3024     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | unittests | `37.09% <0.00%> (-9.08%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/pulsar/pull/18837?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...va/org/apache/pulsar/client/impl/ConsumerImpl.java](https://codecov.io/gh/apache/pulsar/pull/18837/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL0NvbnN1bWVySW1wbC5qYXZh) | `15.09% <0.00%> (-0.04%)` | :arrow_down: |
   | [...he/pulsar/client/impl/MultiTopicsConsumerImpl.java](https://codecov.io/gh/apache/pulsar/pull/18837/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL011bHRpVG9waWNzQ29uc3VtZXJJbXBsLmphdmE=) | `22.78% <0.00%> (-0.09%)` | :arrow_down: |
   | [.../org/apache/pulsar/client/impl/ConnectionPool.java](https://codecov.io/gh/apache/pulsar/pull/18837/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL0Nvbm5lY3Rpb25Qb29sLmphdmE=) | `37.43% <0.00%> (-1.03%)` | :arrow_down: |
   | [.../main/java/org/apache/pulsar/PulsarStandalone.java](https://codecov.io/gh/apache/pulsar/pull/18837/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL1B1bHNhclN0YW5kYWxvbmUuamF2YQ==) | | |
   | [.../pulsar/broker/service/AbstractBaseDispatcher.java](https://codecov.io/gh/apache/pulsar/pull/18837/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL0Fic3RyYWN0QmFzZURpc3BhdGNoZXIuamF2YQ==) | | |
   | [...sistent/PersistentDispatcherMultipleConsumers.java](https://codecov.io/gh/apache/pulsar/pull/18837/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL3BlcnNpc3RlbnQvUGVyc2lzdGVudERpc3BhdGNoZXJNdWx0aXBsZUNvbnN1bWVycy5qYXZh) | | |
   | [...oker/stats/prometheus/PrometheusMetricStreams.java](https://codecov.io/gh/apache/pulsar/pull/18837/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zdGF0cy9wcm9tZXRoZXVzL1Byb21ldGhldXNNZXRyaWNTdHJlYW1zLmphdmE=) | | |
   | [.../apache/pulsar/broker/tools/LoadReportCommand.java](https://codecov.io/gh/apache/pulsar/pull/18837/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci90b29scy9Mb2FkUmVwb3J0Q29tbWFuZC5qYXZh) | | |
   | [...lance/extensions/channel/ServiceUnitStateData.java](https://codecov.io/gh/apache/pulsar/pull/18837/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9sb2FkYmFsYW5jZS9leHRlbnNpb25zL2NoYW5uZWwvU2VydmljZVVuaXRTdGF0ZURhdGEuamF2YQ==) | | |
   | [...ookkeeper/mledger/impl/PositionImplRecyclable.java](https://codecov.io/gh/apache/pulsar/pull/18837/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bWFuYWdlZC1sZWRnZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2Jvb2trZWVwZXIvbWxlZGdlci9pbXBsL1Bvc2l0aW9uSW1wbFJlY3ljbGFibGUuamF2YQ==) | | |
   | ... and [488 more](https://codecov.io/gh/apache/pulsar/pull/18837/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   


-- 
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] BewareMyPower commented on a diff in pull request #18837: [fix][broker] ignore the exception of creating namespace

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on code in PR #18837:
URL: https://github.com/apache/pulsar/pull/18837#discussion_r1044308348


##########
pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java:
##########
@@ -393,7 +393,11 @@ void createNameSpace(String cluster, String publicTenant, NamespaceName ns) thro
         }
 
         if (!nsr.namespaceExists(ns)) {
-            broker.getAdminClient().namespaces().createNamespace(ns.toString());
+            try {
+                broker.getAdminClient().namespaces().createNamespace(ns.toString());
+            } catch (Exception e) {
+                log.warn(e.getMessage());

Review Comment:
   The namespace could be created via `pulsar-admin` with correct authentication info later. See how the C++ client's unit tests set up the test env. https://github.com/apache/pulsar-client-cpp/blob/2018a06e8afcde4de59971cfbc5f653a4f9d7897/build-support/start-test-service-inside-container.sh#L59-L63



-- 
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] nodece commented on a diff in pull request #18837: [fix][broker] ignore the exception of creating namespace

Posted by GitBox <gi...@apache.org>.
nodece commented on code in PR #18837:
URL: https://github.com/apache/pulsar/pull/18837#discussion_r1044305304


##########
pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java:
##########
@@ -393,7 +393,11 @@ void createNameSpace(String cluster, String publicTenant, NamespaceName ns) thro
         }
 
         if (!nsr.namespaceExists(ns)) {
-            broker.getAdminClient().namespaces().createNamespace(ns.toString());
+            try {
+                broker.getAdminClient().namespaces().createNamespace(ns.toString());
+            } catch (Exception e) {
+                log.warn(e.getMessage());

Review Comment:
   When the authentication/authorization is enabled, we must configure the `brokerClientAuthenticationPlugin` and `brokerClientAuthenticationParameters`.



-- 
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] tisonkun commented on pull request #18837: [fix][broker] ignore the exception of creating namespace

Posted by GitBox <gi...@apache.org>.
tisonkun commented on PR #18837:
URL: https://github.com/apache/pulsar/pull/18837#issuecomment-1344107011

   Cross-reference to about:blank


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