Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Fix for RecreateSyncProducerPoolForMetadata() #33

Closed
wants to merge 2 commits into from
Closed

Fix for RecreateSyncProducerPoolForMetadata() #33

wants to merge 2 commits into from

Conversation

maximecaron
Copy link

RecreateSyncProducerPoolForMetadata was never called in RefreshMetadata() if RefreshMetadataInternal throw exceptions.
Thus the consumer get stuck with an invalid list of broker unless KafkaSimpleManager is recreated completely.

If ProducerPoolForMetadata get stale or invalid call to RefreshMetadataInternal will throw Kafka.Client.Exceptions.UnableToConnectToHostException.
Calling RecreateSyncProducerPoolForMetadata will query zookeeper and recreate the pool that is passed to BrokerPartitionInfo by RefreshMetadataInternal allowing for next retry to succeed.

at Kafka.Client.KafkaConnection.Connect()
at Kafka.Client.KafkaConnection.Send(Byte[] data)
at Kafka.Client.KafkaConnection.Handle[T](Byte[] data, IResponseParser`1 parser, Boolean shouldParse)
at Kafka.Client.KafkaConnection.Send(TopicMetadataRequest request)
at Kafka.Client.Producers.Partitioning.BrokerPartitionInfo.UpdateInfo(Int16 versionId, Int32 correlationId, String clientId, String topic)
at Kafka.Client.Helper.KafkaSimpleManager`2.RefreshMetadataInternal(Int16 versionId, String clientId, Int32 correlationId, String topic, Dictionary`2 tempTopicMetadatas, Dictionary`2 tempTopicMetadatasLastUpdateTime, Dictionary`2 partitionLeaders)
at Kafka.Client.Helper.KafkaSimpleManager`2.RefreshMetadata(Int16 versionId, String clientId, Int32 correlationId, String topic, Boolean force)
@msftclas
Copy link

Hi @maximecaron, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. Real humans will now evaluate your PR.

TTYL, MSBOT;

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.

None yet

2 participants