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

fix: correct the error handling in client.InitProducerID() #1718

Merged
merged 1 commit into from
Sep 13, 2021

Conversation

crivera-fastly
Copy link
Contributor

err was shadowed in InitProducerID() so it would never return a non-nil
error. It now returns ErrOutOfBrokers if there aren't any registered brokers.
If there are registered brokers and the broker calls fail then it returns
the last encoutered error.

This was causing a panic in newTransactionManager() with idempotent
production enabled because nil, nil was being returned if the brokers were
unavailable.

@crivera-fastly crivera-fastly requested a review from bai as a code owner June 9, 2020 19:33
@ghost ghost added the cla-needed label Jun 9, 2020
@ghost
Copy link

ghost commented Mar 16, 2021

Thank you for your contribution! However, this pull request has not had any activity in the past 90 days and will be closed in 30 days if no updates occur.
If you believe the changes are still valid then please verify your branch has no conflicts with master and rebase if needed. If you are awaiting a (re-)review then please let us know.

@ghost ghost added the stale Issues and pull requests without any recent activity label Mar 16, 2021
@ghost ghost removed the stale Issues and pull requests without any recent activity label Apr 2, 2021
@ghost ghost removed the cla-needed label May 18, 2021
err was shadowed in InitProducerID() so it would never return a non-nil
error. It now returns ErrOutOfBrokers if there aren't any registered brokers.
If there are registered brokers and the broker calls fail then it returns
the last encoutered error.

This was causing a panic in newTransactionManager() with idempotent
production enabled because nil, nil was being returned if the brokers were
unavailable.
@bai
Copy link
Contributor

bai commented Sep 13, 2021

I rebased this branch off of latest master.

@bai bai requested a review from dnwe September 13, 2021 06:57
@dnwe dnwe changed the title Fix the error handling in client.InitProducerID() fix: correct the error handling in client.InitProducerID() Sep 13, 2021
@dnwe dnwe merged commit 288e019 into IBM:main Sep 13, 2021
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

Successfully merging this pull request may close these issues.

None yet

3 participants