From 378fb222b9a2d594c543e164a21451842c71bacc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Migda=C5=82?= Date: Wed, 15 Jul 2026 21:39:43 +0200 Subject: [PATCH 1/3] Refine logs for when linking elements fails --- .../parent/child_life_controller/link_utils.ex | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/membrane/core/parent/child_life_controller/link_utils.ex b/lib/membrane/core/parent/child_life_controller/link_utils.ex index 66c3cf47e..6fcbc5ccc 100644 --- a/lib/membrane/core/parent/child_life_controller/link_utils.ex +++ b/lib/membrane/core/parent/child_life_controller/link_utils.ex @@ -302,6 +302,20 @@ defmodule Membrane.Core.Parent.ChildLifeController.LinkUtils do state end + defp log_handle_link_error({:call_failure, {:timeout, _reason}}, from, to) do + Membrane.Logger.warning(""" + Failed to establish link between #{inspect(from.child)} via #{inspect(from.pad_ref)} and + #{inspect(to.child)} via #{inspect(to.pad_ref)} because #{inspect(from.child)} took too long to link. + """) + end + + defp log_handle_link_error({:call_failure, {{exception, _stack}, _reason}}, from, to) when is_exception(exception) do + Membrane.Logger.debug(""" + Failed to establish link between #{inspect(from.child)} via #{inspect(from.pad_ref)} and + #{inspect(to.child)} via #{inspect(to.pad_ref)} because #{inspect(from.child)} failed with an exception. + """) + end + defp log_handle_link_error({:call_failure, _reason}, from, to) do Membrane.Logger.debug(""" Failed to establish link between #{inspect(from.child)} via #{inspect(from.pad_ref)} and From a10ba6df08b77ba1cb2bc3646412d1ade8196d6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Migda=C5=82?= Date: Thu, 23 Jul 2026 14:44:41 +0200 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3855238ab..3419323f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 1.3.5 +* Make logs more specific about the reason when linking elements fails [#1167](https://github.com/membraneframework/membrane_core/pull/1167) + ## 1.3.0 * Make errors more descriptive [#1102](https://github.com/membraneframework/membrane_core/pull/1102) * Add `:broadcast` action for sending data to all output pads of an element From 6c9e55b6e3c2958f467f564991f66d550a59baf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Migda=C5=82?= Date: Thu, 23 Jul 2026 14:46:06 +0200 Subject: [PATCH 3/3] mix format --- lib/membrane/core/parent/child_life_controller/link_utils.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/membrane/core/parent/child_life_controller/link_utils.ex b/lib/membrane/core/parent/child_life_controller/link_utils.ex index 6fcbc5ccc..fb8bd7a9e 100644 --- a/lib/membrane/core/parent/child_life_controller/link_utils.ex +++ b/lib/membrane/core/parent/child_life_controller/link_utils.ex @@ -309,7 +309,8 @@ defmodule Membrane.Core.Parent.ChildLifeController.LinkUtils do """) end - defp log_handle_link_error({:call_failure, {{exception, _stack}, _reason}}, from, to) when is_exception(exception) do + defp log_handle_link_error({:call_failure, {{exception, _stack}, _reason}}, from, to) + when is_exception(exception) do Membrane.Logger.debug(""" Failed to establish link between #{inspect(from.child)} via #{inspect(from.pad_ref)} and #{inspect(to.child)} via #{inspect(to.pad_ref)} because #{inspect(from.child)} failed with an exception.