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

add option to return error on non exiting topic for ConsumeTopics opt #439

Closed
vtolstov opened this issue Apr 24, 2023 · 6 comments
Closed
Labels
enhancement New feature or request

Comments

@vtolstov
Copy link
Contributor

sometimes someone =) specify invalid topic name (non exiting), but kgo does not fails on subscribe with ConsumeTopics, does it possible to add ability to return error if topic unknown or client does not have rights to fetch from it or produce?

@twmb
Copy link
Owner

twmb commented Apr 26, 2023

So are you thinking an option to return all retryable errors in fetches, or just this one?

@vtolstov
Copy link
Contributor Author

does it possible to add option to handle all retryable errors so inside this func we can decide to continue retry or not?

@vtolstov
Copy link
Contributor Author

like
type RetryFunc func(ctx context.Context, retryCount int, err error) (bool, error)
so we know how much retries already done, error happened, and can return continue (via first arg), may be via second return arg return something if continue not needed like fmt.Errorf("retry count reached")

@twmb
Copy link
Owner

twmb commented Apr 29, 2023

The client already internally retries following roughly that exact pattern. For fetching, failed partitions are always retried forever. I thought you were asking for an option like,

func KeepFetchRetryableErrors() Opt

such that that retryable errors here:

if kerr.IsRetriable(fp.Err) {
would not be stripped.

@vtolstov
Copy link
Contributor Author

Internally, but if user wants to handle errors via own logic? One use-case - check that topic exists when subscribe to it.

@twmb
Copy link
Owner

twmb commented Apr 30, 2023

In that case, existence checking needs to be done before subscribing to it. However, with the option, you could react to errors (such as a topic being deleted). Would the option above satisfy what you're looking for?

@twmb twmb added the enhancement New feature or request label Jun 27, 2023
@twmb twmb mentioned this issue Jun 30, 2023
17 tasks
twmb added a commit that referenced this issue Jul 7, 2023
For when you want to return retryable errors to the client.

Closes #439.
@twmb twmb closed this as completed in 76d2e71 Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants