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/01/04 17:31:21 UTC

[GitHub] [pulsar-client-go] flowchartsman opened a new issue #434: Regex consumer throws multiple unnecessary errors on topic deletion

flowchartsman opened a new issue #434:
URL: https://github.com/apache/pulsar-client-go/issues/434


   #### Expected behavior
   
   When a topic is deleted, a regex subscriber should simply gracefully close the individual consumer and move on.
   
   #### Actual behavior
   
   As I mention in #432, the client throws a series of scary-looking errors as it attempts to resubscribe to the topic, but is blocked by its own specified desire not to create new topics. It then retries the operation a series of times. 
   
   #### Steps to reproduce
   
   As with #432, once #433 is applied.
   
   #### Suggested fix
   Since the consumer already knows it doesn't want to create a new topic, and since the error returned from the server explicitly states that the topic doesn't exist, the consumer could put two and two together and realize that it shouldn't keep retrying the consumer. Unfortunately, at the moment, the error is returned from `connection.handleResponseError()` as a string:
   
   ```go
   errMsg := fmt.Sprintf("server error: %s: %s", serverError.GetError(), serverError.GetMessage())
   ```
   
   Since `handleResponseError()` already has the `*pb.CommandError`, it could conceivably wrap the message in a type like the following
   
   ```go
   type commandError struct {
       serverErrorType string
       serverErrorMsg string
   }
   ```
   
   Because `ServerError` [is a proto enum](https://github.com/apache/pulsar/blob/73e0dbd4df36571460eeb070964ec498d1955c1d/pulsar-common/src/main/proto/PulsarApi.proto#L189), it should be safe enough to just call `Enum().String()` and select off of that when handling the error.
   
   


----------------------------------------------------------------
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-client-go] flowchartsman edited a comment on issue #434: Regex consumer throws multiple unnecessary errors on topic deletion

Posted by GitBox <gi...@apache.org>.
flowchartsman edited a comment on issue #434:
URL: https://github.com/apache/pulsar-client-go/issues/434#issuecomment-766530582


   (See supplementary discussion in  #433 / #448


----------------------------------------------------------------
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-client-go] flowchartsman edited a comment on issue #434: Regex consumer throws multiple unnecessary errors on topic deletion

Posted by GitBox <gi...@apache.org>.
flowchartsman edited a comment on issue #434:
URL: https://github.com/apache/pulsar-client-go/issues/434#issuecomment-766530582


   (See supplementary discussion in  #433 / #448)


----------------------------------------------------------------
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-client-go] flowchartsman commented on issue #434: Regex consumer throws multiple unnecessary errors on topic deletion

Posted by GitBox <gi...@apache.org>.
flowchartsman commented on issue #434:
URL: https://github.com/apache/pulsar-client-go/issues/434#issuecomment-766530582


   (See supplementary discussion in  #433)


----------------------------------------------------------------
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-client-go] flowchartsman edited a comment on issue #434: Regex consumer throws multiple unnecessary errors on topic deletion

Posted by GitBox <gi...@apache.org>.
flowchartsman edited a comment on issue #434:
URL: https://github.com/apache/pulsar-client-go/issues/434#issuecomment-766530582






----------------------------------------------------------------
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-client-go] flowchartsman commented on issue #434: Regex consumer throws multiple unnecessary errors on topic deletion

Posted by GitBox <gi...@apache.org>.
flowchartsman commented on issue #434:
URL: https://github.com/apache/pulsar-client-go/issues/434#issuecomment-766530582


   (See supplementary discussion in  #433)


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