membraneframework / membrane_core

The core of the Membrane Framework, multimedia processing framework written in Elixir
https://membrane.stream
Apache License 2.0
1.31k stars 39 forks source link

Traverse pipeline topology looking for the flow control stuck vunerability #873

Open FelonEkonom opened 1 month ago

FelonEkonom commented 1 month ago

Every randomized time interval check if there is a diamond structure in the pipeline topology with a root having :auto flow control and pull effective flow control (and proper flow control on both paths to the "leaf").

If it occurs, add a debug/warning log informing about possibility of getting stuck, if the data will be unbalanced and possible solutions (setting auto_demand_size to a bigger number, modifying pipeline topology).

Another possible approach is to auto-magically-bump auto_demand_size in case of getting stuck

FelonEkonom commented 1 week ago

Proposition of algorithm finding diamond structure: Start DFS/BFS in every vertex, if you enter some other vertex more than once, it means that there is a diamond there, but it has not be minimal diamond in terms of inclusion. The goal is to find only minimal diamonds.