How supervisor behavior in Elixir Umbrella Apps: Managing Failures Across Applications

48 Views Asked by At

In Elixir umbrella apps, when an error occurs in one application (e.g., appA) and its supervisor determines that the error cannot be recovered, the supervisor might terminate the entire umbrella application, affecting not only appA but also appB. I want to know how supervisors work within umbrella apps, their fault-tolerance strategies, and how to handle such scenarios effectively.

I check the supervision tree with wxwidget there are two seperate supervisor. But why behaving like killing both apps in my case.

Any link or explanation would be appreciate.

1

There are 1 best solutions below

0
AungMyoOo On

As a starting point, let’s define a release that includes both :kv_server and :kv applications. We will also add a version to it. Open up the mix.exs in the umbrella root and add inside def project:

releases: [
  foo: [
    version: "0.0.1",
    applications: [kv_server: :permanent, kv: :permanent]
  ]
]

That defines a release named foo with both kv_server and kv applications. Their mode is set to :permanent, which means that, if those applications crash, the whole node terminates. That’s reasonable since those applications are essential to our system.

https://elixir-lang.org/getting-started/mix-otp/config-and-releases.html#releases