# Concurrent Data Processing in Elixir: JobSupervisor does not go down (page 54)

**URL:** <https://forum.devtalk.com/t/concurrent-data-processing-in-elixir-jobsupervisor-does-not-go-down-page-54/6870>\
**Category:** PragProg Customers\
**Tags:** book-concurrent-data-processing-in-elixir, question\
**Created:** [10 February 2021 15:08 UTC](https://forum.devtalk.com/t/concurrent-data-processing-in-elixir-jobsupervisor-does-not-go-down-page-54/6870 "2021-02-10T15:08:57Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![svilen](https://forum.devtalk.com/user_avatar/forum.devtalk.com/svilen/32/529_2.png) [@svilen](https://forum.devtalk.com/u/svilen)\
**Post date:** [21 March 2021 16:12 UTC](https://forum.devtalk.com/t/concurrent-data-processing-in-elixir-jobsupervisor-does-not-go-down-page-54/6870/5 "2021-03-21T16:12:43Z")

</div>

No problem at all @kunna.

> [@kunna](#):
>
> what if “Jobber.JobSupervisor” was restarting its children? Isn’t there a possibility “Supervisor.count\_children(pid).active == 0” will return true for a while?

If a child is being restarted, then `which_children/1` will return `:restarting` for the second element in the tuple, so you can use that in combination with `count_children/1`. Please see the [documentation for which\_children/1](https://hexdocs.pm/elixir/Supervisor.html#which_children/1).

> [@kunna](#):
>
> who should be responsible to run this code? I cannot think of a good place to add this code, should we add a new GenServer for this code?

Yes, you can make a `JobTerminator` GenServer that does that.

---

_[View the full topic](https://forum.devtalk.com/t/concurrent-data-processing-in-elixir-jobsupervisor-does-not-go-down-page-54/6870)._
