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 2020/08/03 06:55:11 UTC

[GitHub] [pulsar] murong00 opened a new pull request #7725: Change some WebApplicationException log level to debug

murong00 opened a new pull request #7725:
URL: https://github.com/apache/pulsar/pull/7725


   ### Motivation
   Some user may face the following `Temporary Redirect` issue when the request topic not owned by the current broker:
   ```
   19:21:48.215 [pulsar-web-42-5] ERROR org.apache.pulsar.broker.admin.impl.PersistentTopicsBase - [admin] Failed to get list of subscriptions for persistent://default_tenant/default_namespace/default_topic-partition-0
   javax.ws.rs.WebApplicationException: HTTP 307 Temporary Redirect
   	at org.apache.pulsar.broker.web.PulsarWebResource.validateTopicOwnership(PulsarWebResource.java:599)
   	at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.validateReadOperationOnTopic(PersistentTopicsBase.java:245) 
   	at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.internalGetSubscriptionsForNonPartitionedTopic(PersistentTopicsBase.java:874) 
   	at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.internalGetSubscriptions(PersistentTopicsBase.java:825) 
   	at org.apache.pulsar.broker.admin.v2.PersistentTopics.getSubscriptions(PersistentTopics.java:461)
   
   09:41:45.485 [pulsar-web-42-7] WARN  org.apache.pulsar.broker.admin.impl.PersistentTopicsBase - [admin] [persistent://public/default/test-partition-1] Failed to create subscription consumer-test at message id -1:-1:-1
   javax.ws.rs.WebApplicationException: HTTP 307 Temporary Redirect
           at org.apache.pulsar.broker.web.PulsarWebResource.validateTopicOwnership(PulsarWebResource.java:599)
           at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.validateAdminAccessForSubscriber(PersistentTopicsBase.java:283)
           at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.internalCreateSubscriptionForNonPartitionedTopic(PersistentTopicsBase.java:1752)
           at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.internalCreateSubscription(PersistentTopicsBase.java:1673)
           at org.apache.pulsar.broker.admin.v2.PersistentTopics.createSubscription(PersistentTopics.java:816)
   ```
    As discussed in https://github.com/apache/pulsar/issues/7189, it is better to use debug level when this happens.
   
   ### Modifications
   
   Change some `WebApplicationException` log level from error/warn to debug in `PersistentTopicsBase`.


----------------------------------------------------------------
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] murong00 commented on a change in pull request #7725: Change some WebApplicationException log level to debug

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



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
##########
@@ -599,6 +599,11 @@ protected PartitionedTopicMetadata internalGetPartitionedMetadata(boolean author
     protected void internalDeletePartitionedTopic(AsyncResponse asyncResponse, boolean authoritative, boolean force) {
         try {
             validateWriteOperationOnTopic(authoritative);
+        } catch (WebApplicationException wae) {
+            log.debug("[{}] Failed to delete partitioned topic {}, redirecting to other brokers.",

Review comment:
       Done.




----------------------------------------------------------------
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] codelipenghui commented on a change in pull request #7725: Change some WebApplicationException log level to debug

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



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
##########
@@ -599,6 +599,11 @@ protected PartitionedTopicMetadata internalGetPartitionedMetadata(boolean author
     protected void internalDeletePartitionedTopic(AsyncResponse asyncResponse, boolean authoritative, boolean force) {
         try {
             validateWriteOperationOnTopic(authoritative);
+        } catch (WebApplicationException wae) {
+            log.debug("[{}] Failed to delete partitioned topic {}, redirecting to other brokers.",

Review comment:
       Please add check for the debug is enabled
   if(log.isDebugEnable) {
     log.debug("....")
   }




----------------------------------------------------------------
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] sijie merged pull request #7725: Change some WebApplicationException log level to debug

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


   


----------------------------------------------------------------
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] wolfstudy commented on pull request #7725: Change some WebApplicationException log level to debug

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


   cherry-pick the pull request to branch-2.6


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