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

failed to add producer to topic after connection closed #5535

Closed
disanji opened this issue Nov 1, 2019 · 0 comments · Fixed by #5571
Closed

failed to add producer to topic after connection closed #5535

disanji opened this issue Nov 1, 2019 · 0 comments · Fixed by #5571
Assignees
Labels
area/broker type/bug The PR fixed a bug or issue reported a bug
Milestone

Comments

@disanji
Copy link

disanji commented Nov 1, 2019

Client timed out while trying to send message to brokers, and failed to add producer to topic. Below are related logs.

connection closed log:
WeChatWorkScreenshot_9cd78c74-bd86-4bbd-bafa-1662679f50f7

client log:
企业微信截图_2065c1f1-3a3c-4703-b437-c6d35e9de62f
企业微信截图_008d5a89-4c15-4dc6-ae21-1cd9db278c5b

broker log:
企业微信截图_d3451b70-f576-418f-91e6-bbd1ea6662de

@disanji disanji added the type/bug The PR fixed a bug or issue reported a bug label Nov 1, 2019
@codelipenghui codelipenghui self-assigned this Nov 5, 2019
@codelipenghui codelipenghui added this to the 2.5.0 milestone Nov 5, 2019
jiazhai pushed a commit that referenced this issue Nov 19, 2019
…5571)

Fixes #5535

Motivation
Currently, if user create producer timeout, the connection handler of producer will reconnect to the broker later, but if in broker already done the previous create producer request, the reconnection will failed with "producer with name xxx is already connected".

So this PR will introduce epoch for connection handler and add a field named isGeneratedName for producer to handle above problem.

This PR only handle the generated producer name scenario, so many users occur errors such like
#5535, so we need to fix the generated producer name scenario first.

For the scenario of user specified producer name, we can discuss later and find a simple approach to handle it, i left my idea here: using producer id and producer name as the identity of producer, producer name used for EO producer and producer id can used by the producer reconnect, but this approach depends on globally unique producer id generator.

Modifications
If the producer with generated producer name and epoch of the producer is bigger than the exists producer, the new producer will overwrite the old producer, so the reconnect producer will create succeed.

Verifying this change
Add unit tests to simulate producer timeout and reconnection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/broker type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants