question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ProduceAsync still deadlocks for nuget version: Confluent.Kafka -Version 1.0.0-experimental-12

See original GitHub issue

Description

I upgraded to Confluent.Kafka -Version 1.0.0-experimental-12 according to what you mentioned here. If I am not wrong, this package includes 1.0-experimental-9.

#545

But I still see ProduceAsync deadlock (for a console application). I added debug: all in the config and captures the following log:

image

Here is the relevant code:

  var config = new Dictionary<string, object> {
            { "bootstrap.servers", "192.168.0.228:9092" },
            { "queue.buffering.max.ms", 1 },
            { "socket.blocking.max.ms", 1 },
            { "debug", "all"}
        };
        _producer = new Producer<string, string>(config, new StringSerializer(Encoding.UTF8), new StringSerializer(Encoding.UTF8));

    public void Publish<T>(T message) where T : IExternalMessage
    {
        if (message == null) throw new ArgumentNullException("message");
        var value = JsonConvert.SerializeObject(message, ExternalMessageConverters.SerializerSettings);
        Logger.Info("Publishing External Message: " + message.GetType().FullName + "\r\n" + value);
        var partition = new TopicPartition(_topicNamePrefix + message.Topic, new Partition(message.PartitionKey % 20));
        var m = new Message<string, string>
        {
            Key = message.Key,
            Value = value
        };
        Console.WriteLine("BEGIN ProduceAsync: {0}", DateTime.Now);
        _producer.ProduceAsync(partition, m).Wait();
        Console.WriteLine("END ProduceAsync: {0}", DateTime.Now);
        //AsyncContext.Run(async () =>
        //{
        //});
        Logger.Info("DONE Publishing Message");
    }

The entire log is attached below:

entire.log

How to reproduce

Checklist

Please provide the following information:

  • Confluent.Kafka nuget version: Confluent.Kafka -Version 1.0.0-experimental-12
  • Apache Kafka version: kafka_2.11-2.0.0
  • Client configuration: see code above
  • Operating system: Client runs on Windows 7 (my dev machine). Kafka Server runs in Ubuntu 14.04.5 LTS
  • Provide logs (with “debug” : “…” as necessary in configuration)
  • Provide broker log excerpts
  • Critical issue

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
mhowlettcommented, Nov 8, 2018

thanks for the input @foresightyj. re-opening as a reminder to investigate further.

1reaction
kieddcommented, Dec 13, 2018

There is also possibility, that using Task.Wait() on asynchronous method (which is ProduceAsync) causes deadlock. If you want to execute async method synchronously, you should use GetAwaiter().GetResult()

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kafka .NET Client
NET library that provides a high-level Producer, Consumer and AdminClient compatible with all Apache Kafka® brokers version 0.8 and later, Confluent Cloud ...
Read more >
Supported Versions and Interoperability for Confluent ...
This topic provides the supported versions and interoperability of Confluent Platform and its components. Confluent Platform and Apache Kafka compatibility¶ ...
Read more >
Confluent.Kafka 2.2.0
Confluent.Kafka 2.2.0 .NET 6.0 .NET Standard 1.3 .NET Framework 4.6.2 .NET CLI; Package Manager; PackageReference; Paket CLI; Script & Interactive; Cake.
Read more >
Install Clients | Confluent Platform 5.1.4
Install Clients¶. Confluent Platform includes client libraries for multiple languages that provide both low level access to Apache Kafka® ...
Read more >
Confluent Platform 7.4 Release Notes
7.4 is a major release of Confluent Platform that provides you with Apache Kafka® 3.4, the latest stable version of Kafka. The technical...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found