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/06/27 20:39:05 UTC

[GitHub] [pulsar] frankjkelly opened a new issue, #16249: Pulsar Admin API client should support retries on operations

frankjkelly opened a new issue, #16249:
URL: https://github.com/apache/pulsar/issues/16249

   **Is your enhancement request related to a problem? Please describe.**
   When autoscaling brokers up and down the namespace bundles move about.
   I would like for the Admin Client to handle the retries when a namespace bundle moves and I am trying to either create a new topic or delete a topic.
   
   As best I can tell the Pulsar Client Admin code does not support retries .
   
   Compare Admin Client https://github.com/apache/pulsar/blob/master/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/BaseResource.java
   
   to Pulsar Client 
   https://github.com/apache/pulsar/blob/04aa9e8e51869d1621a7e25402a656084eebfc09/pulsar-client/src/main/java/org/apache/pulsar/client/util/RetryUtil.java
   
   **Describe alternatives you've considered**
   Leave things as they are but this means that the Pulsar Client and the Admin Client are inconsistent and
   then I have to write the retry code myself which I am finding complex as certain exceptions are retryable e.g. 503
   but others are not e.g. Topic already exists
   
   CC: @sijie 


-- 
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.apache.org

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


[GitHub] [pulsar] martijngonlag commented on issue #16249: Pulsar Admin API client should support retries on operations

Posted by GitBox <gi...@apache.org>.
martijngonlag commented on issue #16249:
URL: https://github.com/apache/pulsar/issues/16249#issuecomment-1370087755

   @frankjkelly Based on some discussions, the recommended approach here would be to handle the retries on the client side by leveraging the pulsar-admin's response codes. 


-- 
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] github-actions[bot] commented on issue #16249: Pulsar Admin API client should support retries on operations

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #16249:
URL: https://github.com/apache/pulsar/issues/16249#issuecomment-1197577195

   The issue had no activity for 30 days, mark with Stale label.


-- 
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] github-actions[bot] commented on issue #16249: Pulsar Admin API client should support retries on operations

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #16249:
URL: https://github.com/apache/pulsar/issues/16249#issuecomment-1279874181

   The issue had no activity for 30 days, mark with Stale label.


-- 
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] frankjkelly commented on issue #16249: Pulsar Admin API client should support retries on operations

Posted by GitBox <gi...@apache.org>.
frankjkelly commented on issue #16249:
URL: https://github.com/apache/pulsar/issues/16249#issuecomment-1397034421

   @eolivelli Thank you - yes that was my thinking / hope too - consistency is awesome as it reduces cognitive load and anything that helps "pave a golden path" will help with adoption 🙏 😄 


-- 
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 issue #16249: Pulsar Admin API client should support retries on operations

Posted by GitBox <gi...@apache.org>.
eolivelli commented on issue #16249:
URL: https://github.com/apache/pulsar/issues/16249#issuecomment-1396546157

   I think that it makes sense to retry some (most) of the admin operations.
   We do retries while producing messages why can't we do them in the admin API ?
   
   


-- 
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] frankjkelly commented on issue #16249: Pulsar Admin API client should support retries on operations

Posted by GitBox <gi...@apache.org>.
frankjkelly commented on issue #16249:
URL: https://github.com/apache/pulsar/issues/16249#issuecomment-1214432319

   Bump @sijie ?


-- 
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] frankjkelly commented on issue #16249: Pulsar Admin API client should support retries on operations

Posted by GitBox <gi...@apache.org>.
frankjkelly commented on issue #16249:
URL: https://github.com/apache/pulsar/issues/16249#issuecomment-1396150858

   @martijngonlag Sorry I took so long to get back to you.
   
   The problem then becomes our code is littered with the following since some of the exceptions are not retryable and others are. And then we have to catch this further up and (using Spring) do the retries. It's an awful lot of boilerplate and particularly problematic for customers like us that create and delete a lot of topics. Especially with ZK being such a non-performant beast (and involved on the create/delete topic flow).
   
   ```
       private void createTopic(final URI topic) throws StreamManagerAdminException {
           try {
               val start = System.currentTimeMillis();
               pulsarAdmin.topics().createNonPartitionedTopic(topic.toString());
               val durationMs = System.currentTimeMillis() - start;
               recordDurationMetric("createTopic", durationMs);
           } catch (final PulsarAdminException e) {
               castAndRethrowException(e);
           }
       }
   
   
       private void castAndRethrowException(final PulsarAdminException e) throws StreamManagerAdminException {
           //Need to be able to distinguish between exceptions to be able to know which are retryable or not
           // However we do not want to expose Pulsar Internals beyond this layer
           if (e.getStatusCode() == 503) {
               throw new StreamManagerServiceUnavailableException(e);
           } else if (didPulsarAdminExhaustRetries(e)) {
               throw new StreamManagerRetryException(e);
           } else {
               throw new StreamManagerAdminException(e);
           }
       }
   ```
   


-- 
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] github-actions[bot] commented on issue #16249: Pulsar Admin API client should support retries on operations

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #16249:
URL: https://github.com/apache/pulsar/issues/16249#issuecomment-1246145069

   The issue had no activity for 30 days, mark with Stale label.


-- 
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] frankjkelly commented on issue #16249: Pulsar Admin API client should support retries on operations

Posted by GitBox <gi...@apache.org>.
frankjkelly commented on issue #16249:
URL: https://github.com/apache/pulsar/issues/16249#issuecomment-1246630837

   Bump


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