Skip to content

Commit 54c5016

Browse files
committed
Apply CR suggestions
1 parent 84f94c2 commit 54c5016

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

guides/useful_concepts/crash_groups.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ Crash groups provide a mechanism to manage the lifecycle of elements within a pi
66

77
In Membrane, elements and bins are Elixir processes. By default, if an element that is not inside a crash group crashes, it leads to the crash of the whole pipeline.
88

9-
The fundamental purpose of crash groups is to isolate the crash of a specific element from the rest of the pipeline. If an element is likely to crash (e.g., it interacts with unstable external resources), it is usually placed in a crash group along with other elements whose operation is inextricably connected to it. This prevents a localized failure from bringing down the entire system and allows for the controlled recovery of specific logical units. This approach also ensures that components generally needing a restart or termination are cleaned up correctly.
9+
The fundamental purpose of crash groups is to isolate the crash of a specific element from the rest of the pipeline. If an element is likely to crash (e.g., it interacts with unstable external resources), it is usually assigned to a crash group containing all elements inextricably linked to its operation. This prevents a localized failure from bringing down the entire system and allows for the controlled recovery of specific logical units. This approach also ensures that components generally needing a restart or termination are cleaned up correctly.
1010

1111
## Defining Crash Groups
1212

13-
Crash groups are defined in the `spec` within your pipeline or bin. To create a crash group, you must define a group name and set the `crash_group_mode` to `:temporary`, as shown in the example below:
13+
Crash groups are defined in the `spec` within your pipeline or bin. They are built upon the concept of **Children Groups**, which allow aggregating spawned children into easily identifiable groups.
14+
15+
To create a crash group, you must assign children to a group using the `group` option and set the `crash_group_mode` to `:temporary`. This turns a regular group into a crash group, enabling the crash handling behavior.
1416

1517
```elixir
1618
defmodule MyPipeline do
@@ -28,6 +30,8 @@ defmodule MyPipeline do
2830
end
2931
```
3032

33+
In the example above, `:source`, `:filter`, and `:sink` are all assigned to the same group `:my_group`. Because `crash_group_mode` is set to `:temporary`, this group functions as a crash group.
34+
3135
## Behaviour
3236

3337
When an element belonging to a crash group crashes:

0 commit comments

Comments
 (0)