spectrum-finance / ergo-dex-backend

Spectrum Finance backend services including AMM bots and OrderBook matcher
Creative Commons Zero v1.0 Universal
39 stars 17 forks source link

[Logs] kafka TOPIC_ALREADY_EXISTS (Topic 'hc' already exists.) - what does this mean? #98

Open ccgarant opened 9 months ago

ccgarant commented 9 months ago

While watching the logs after first launching the bot, I'm getting repeated kafka "TOPIC_ALREADY_EXISTS (Topic 'hc' already exists.) " followed by ergo-amm-executioner new heights.

What does this actually mean? Is this an error?

kafka | [2024-02-20 02:12:03,724] INFO [Controller 1] CreateTopics result(s): CreatableTopic(name='hc', numPartitions=-1, replicationFactor=-1, assignments=[], configs=[]): TOPIC_ALREADY_EXISTS (Topic 'hc' already exists.) (org.apache.kafka.controller.ReplicationControlManager)

fonzdm commented 6 months ago

Hi, trying to give some hint here. I think it's related to the container healthcheck definition in the docker-compose.yaml file:

healthcheck:
      test: [ "CMD-SHELL", "kafka-topics.sh --bootstrap-server kafka:9092 --topic hc --create --if-not-exists && kafka-topics.sh --bootstrap-server kafka:9092 --topic hc --describe" ]

So it will try to create (if not existent) the "hc" topic at each check. Probably it's redundant for the simlpe healthcheck purpose but anyway, this should justify the logs you are seeing.

ccgarant commented 6 months ago

That's definitely close than where I was. Thanks. I wonder now how I can work around this. I'll try tweaking things and report back. Any ideas welcomed.