Killing the Cachex process crashes the entire application

Hello I’m having hard time finding out whats the problem here.
I was trying to test the supervision tree by killing the child processes until I found something interesting.
Killing the Cachex process(using :observer.start tool) crashes the entire application.
I have elixir application and under the application supervision tree I start the Cachex process.
I can kill other processes with no problem and they all start up again except the Cachex process.
I am afraid if the Cachex process dies it will sink the whole ship.
It’s umbrella project if that makes any difference. Cachex version is: 3.4.0

defmodule Streamer.Application do
  use Application

  @impl Application
  @spec start(any, any) :: {:error, any} | {:ok, pid}
  def start(_type, _args) do
    children = [
      {Cachex, :misc}
    ]

    opts = [strategy: :one_for_one, name: Streamer.Supervisor]
    Supervisor.start_link(children, opts)
  end
end

Thanks for anybody replying!

Was my fault and Cachex seems to work as expected.
I was closing the Cachex process with the :kill signal not with the :shutdown signal.
Pretty much force killing the Cachex process along with the ETS table which took down the whole application.

2 Likes

@anuarsaeed glad you found it. Note to self, don’t :kill anything connected to ETS…

That’s a good lesson in understanding the guts of the BEAM and how things are interconnected, thanks for sharing your learning.

3 Likes