confluentinc / confluent-kafka-dotnet

Confluent's Apache Kafka .NET client
https://github.com/confluentinc/confluent-kafka-dotnet/wiki
Apache License 2.0
60 stars 862 forks source link

[Question] How to detect the client processes being in "zombie" state? #2196

Open quixoticaxis opened 6 months ago

quixoticaxis commented 6 months ago

The problem

1) We had to use Linux releases that are based on the older kernel versions and contain deadlock inducing bugs in libc. Sometimes the server gets completely stuck during garbage collection. (It is a known issue which can be fixed by upgrading the OS to the newer versions.) 2) We have some processes that may need a lot of memory occasionally and can stuck in non-bugged garbage collection for longer than session.timeout.ms.

Both cases show the same behavior: the managed code is stopped, while the unmanaged threads work, so we have to wait up to max poll interval for the consumer to be dropped out of the group as a zombie process.

The questions

Is it possible to somehow detect such zombie state? One thing I could think of is bringing the heartbeat thread to the managed code, but I don't know how to do it with Confluent's .Net client. (I also failed to grasp whether manual heartbeat management is supported in librdkafka.)

If there is no viable solution, would it be possible to add an option of managing heartbeats in managed code as a feature? Both the "to-managed" transition of a thread and the user facing solution, when the user needs to indefinitely call some method to send heartbeats, would work for us.