logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: e3c9256f4633a4f29d67959347a3ebeabcc7b665
parent dc9265155bf0e5aa748857c6c65d95877391831b
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Thu, 22 Feb 2024 01:00:21 +0100

Revert "Fix Gun connection supervisor logic error"

This reverts commit 0eca3e38ebd6c5b1e7135275959d984af7acfd26.

Diffstat:

Dchangelog.d/gun_pool.fix1-
Mlib/pleroma/gun/connection_pool/worker_supervisor.ex4+---
2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/changelog.d/gun_pool.fix b/changelog.d/gun_pool.fix @@ -1 +0,0 @@ -Fix logic error in Gun connection pooling which prevented retries even when the worker was launched with retry = true diff --git a/lib/pleroma/gun/connection_pool/worker_supervisor.ex b/lib/pleroma/gun/connection_pool/worker_supervisor.ex @@ -21,9 +21,7 @@ defmodule Pleroma.Gun.ConnectionPool.WorkerSupervisor do def start_worker(opts, retry \\ false) do case DynamicSupervisor.start_child(__MODULE__, {Pleroma.Gun.ConnectionPool.Worker, opts}) do {:error, :max_children} -> - funs = [fn -> !retry end, fn -> match?(:error, free_pool()) end] - - if Enum.any?(funs, fn fun -> fun.() end) do + if Enum.any?([retry, free_pool()], &match?(&1, :error)) do :telemetry.execute([:pleroma, :connection_pool, :provision_failure], %{opts: opts}) {:error, :pool_full} else