Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISSUE-434: Regex consumer throws multiple unnecessary errors on topic deletion #134

Open
sijie opened this issue Jan 4, 2021 · 0 comments

Comments

@sijie
Copy link
Member

sijie commented Jan 4, 2021

Original Issue: apache#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 apache#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 apache#432, once apache#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:

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

type commandError struct {
    serverErrorType string
    serverErrorMsg string
}

Because ServerError is a proto enum, it should be safe enough to just call Enum().String() and select off of that when handling the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant