Closed danbaranov closed 4 years ago
Because a child can be restarted, :active
would return 0 if it is being restarted and :workers
would return 1.
At some moment of time sometimes we see no consumers left in Registry
How do you know there are no consumers left in the Registry? For example, if you have a slow producer and fast consumers, you can constantly have no entries in the registry while you wait for new messages to be produced, but that doesn't mean the pipeline is over.
Correct answer in our case was: child was crashing shortly after start and restarting.
Thanks for the hint!
Hello!
In
ConsumerSupervisor
docscount_children
function (https://hexdocs.pm/gen_stage/ConsumerSupervisor.html#count_children/1) returnsactive
processes running. As stated in the docthe count of all actively running child processes managed by this supervisor
. What does it precisely mean? Is it all consumer workers started by this ConsumerSupervisor or all process including maybe some genservers started by this workers?The problem we have is gen_stage tree auto shutdown. We stop producer if all consumers done their job. We also track all consumers with Registry. At some moment of time sometimes we see no consumers left in Registry but
active: 1
returned bycount_children
. Is it expected behaviour?Thanks in advance!