8000 datasync: fix create kafka topic by zacscoding · Pull Request #1157 · klaytn/klaytn · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Aug 19, 2024. It is now read-only.

datasync: fix create kafka topic #1157

Merged
merged 1 commit into from
Apr 21, 2022
Merged

datasync: fix create kafka topic #1157

merged 1 commit into from
Apr 21, 2022

Conversation

zacscoding
Copy link
Contributor

Proposed changes

  • ignore sarama.ErrTopicAlreadyExists when creating a new kafka topic in chaindatafetcher

Types of changes

Please put an x in the boxes related to your change.

  • Bugfix
  • New feature or enhancement
  • Others

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING GUIDELINES doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes ($ make test)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Related issues

  • Please leave the issue numbers or links related to this PR here.

Further comments

When configured docker compose which contains EN services with chaindatafetcher, some containers failed to start
because topic already exists i.e. concurrency problem :(

@@ -104,7 +104,9 @@ func (k *Kafka) setupTopic(topicName string) error {

if err := k.CreateTopic(topicName); err != nil {
logger.Error("creating a topic is failed", "topicName", topicName, "err", err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this log needs to be placed before return err.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed :)

Copy link
Member
@aidan-kwon aidan-kwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@zacscoding zacscoding merged commit 0241baf into klaytn:dev Apr 21, 2022
@ehnuje
Copy link
Contributor
ehnuje commented Apr 21, 2022

The first merged PR from @zacscoding 🎊 🎊 !!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0