Skip to content

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

Merged
dnwe merged 1 commit intoIBM:mainfrom
crivera-fastly:fix-init-producer-id
Sep 13, 2021
Merged

fix: correct the error handling in client.InitProducerID()#1718
dnwe merged 1 commit intoIBM:mainfrom
crivera-fastly:fix-init-producer-id

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
@crivera-fastly crivera-fastly force-pushed the fix-init-producer-id branch from af35301 to 5cd020c Compare May 18, 2021 21:13
@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 bai force-pushed the fix-init-producer-id branch from 5cd020c to 193bd0f Compare September 13, 2021 06:50
@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.

3 participants