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

Error when starting pipeline that includes an element using C Nodes #346

Closed Qizot closed 2 years ago

Qizot commented 3 years ago

Before the introduction of API allowing to start membrane elements on other node starting the pipeline that was spawning elements utilizing C Nodes worked just fine, if it was started with non-distributed version it got upgraded to distributed one.

Right now there is a race condition when application is being started with non-distributed erlang and some new element using C Nodes gets spawned. Application starts with node :nonode@nohost and the pipeline will try to spawn a child on that node as well, but once the element with C Node gets started the distribution will dynamically change and the node :nonode@nohost will no longer be available. At some point it will case the pipeline to crash as there will be some nodes variables competing :nonode@nohost vs newly generated node name.

The quick solution to that is to always start the appliation in distributed environment when we know there is an element using C Node API but it is a great inconvenience for other users using the framework as they probably should not be aware of such tiny details.

Such case happened for the first time when using membrane_ice_plugin which can operate in two modes:

where C Nodes version is a default one, which means a person using the plugin will by default always encounter the error unless he intentionally uses the distribution.

mat-hek commented 3 years ago

A solution could be to identify elements on local nodes by some specific indicator instead of the node name (which may change)