mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-11-14 13:02:08 +00:00
Merge branch 'gun-pool-retry' into 'develop'
Gun connection pool retry fix See merge request pleroma/pleroma!4076
This commit is contained in:
commit
00e828b1a0
3 changed files with 6 additions and 1 deletions
1
changelog.d/gun_pool2.fix
Normal file
1
changelog.d/gun_pool2.fix
Normal file
|
@ -0,0 +1 @@
|
|||
Connection pool errors when publishing an activity is a soft-error that will be retried shortly.
|
|
@ -21,7 +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]
|
||||
funs = [fn -> retry end, fn -> match?(:error, free_pool()) end]
|
||||
|
||||
if Enum.any?(funs, fn fun -> fun.() end) do
|
||||
:telemetry.execute([:pleroma, :connection_pool, :provision_failure], %{opts: opts})
|
||||
|
|
|
@ -129,6 +129,10 @@ defmodule Pleroma.Web.ActivityPub.Publisher do
|
|||
_ -> {:error, e}
|
||||
end
|
||||
|
||||
{:error, :pool_full} ->
|
||||
Logger.debug("Publisher snoozing worker job due to full connection pool")
|
||||
{:snooze, 30}
|
||||
|
||||
e ->
|
||||
unless params[:unreachable_since], do: Instances.set_unreachable(inbox)
|
||||
Logger.metadata(activity: id, inbox: inbox)
|
||||
|
|
Loading…
Reference in a new issue