fix(gun): tolerate a missing client monitor on release
A client that is already gone leaves no monitor to demonitor. Crashing the worker takes the shared connection down with it and fails every other client using it.
This commit is contained in:
parent
24bdd9774a
commit
f985346fe8
1 changed files with 3 additions and 1 deletions
|
|
@ -98,7 +98,9 @@ defmodule Pleroma.Gun.ConnectionPool.Worker do
|
||||||
|
|
||||||
{ref, state} = pop_in(state.client_monitors[client_pid])
|
{ref, state} = pop_in(state.client_monitors[client_pid])
|
||||||
|
|
||||||
Process.demonitor(ref, [:flush])
|
# A client that is already gone has no monitor left. Tolerate it rather than
|
||||||
|
# crashing the worker, which would take the shared connection down with it.
|
||||||
|
if ref, do: Process.demonitor(ref, [:flush])
|
||||||
|
|
||||||
timer =
|
timer =
|
||||||
if used_by == [] do
|
if used_by == [] do
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue