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

对于 topic 不存在时获取 meta 信息直接抛出异常(移除重试) #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anoxia
Copy link

@anoxia anoxia commented Aug 16, 2023

当生产者关闭自动创建 topic 参数设置,然后发起投递时会出现获取 topic meta 数据一直重试问题,代码在此陷入递归死循环。基于有问题尽早抛出原则,建议移除 ErrorCode::UNKNOWN_TOPIC_OR_PARTITION 这个 case 分支,直接抛出异常。

@anoxia
Copy link
Author

anoxia commented Aug 16, 2023

issue:#80
@limingxinleo

@limingxinleo
Copy link
Collaborator

@Yurunsoft 你觉得呢?

@Yurunsoft
Copy link
Member

时间有点久,记不太清了,建议测一下自动创建topic的情况

@anoxia
Copy link
Author

anoxia commented Aug 16, 2023

我这边基于这个库做二次封装,写测试时发现了这个问题😂,就我测试而言以下两种情况均会导致死循环:

  1. kafka 禁用自动创建 Topic;
  2. 生产者/消费者禁用 autoCreateTopic 参数设置。

@Yurunsoft

@Yurunsoft
Copy link
Member

作为一个库要同时兼顾各种情况,要做到禁用和启用自动创建Topic都可以正常运行

@anoxia
Copy link
Author

anoxia commented Aug 16, 2023

作为一个库要同时兼顾各种情况,要做到禁用和启用自动创建Topic都可以正常运行

赞同,以上说的两个问题在 kafka 开启允许自动创建 topic 并且消费者/生产者为禁用 autoCreateTopic 情况下工作正常,不会出现递归重试问题。

请大佬进一步验证。

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