Commit 7115c5f8 authored by rinpatch's avatar rinpatch

ConnectionPool.Worker: do not stop with an error when there is a timeout

This produced error log messages about GenServer termination
every time the connection was not open due to a timeout.

Instead we stop with `{:shutdown, <gun_error>}` since shutting down
when the connection can't be established is normal behavior.
parent 6d583bcc
......@@ -53,7 +53,10 @@ defp get_gun_pid_from_worker(worker_pid, register) do
{:ok, pid}
{:DOWN, ^ref, :process, ^worker_pid, reason} ->
{:error, reason}
case reason do
{:shutdown, error} -> error
_ -> {:error, reason}
end
end
end
......
......@@ -31,7 +31,7 @@ def handle_continue({:connect, [key, uri, opts, client_pid]}, _) do
:hibernate}
else
err ->
{:stop, err, nil}
{:stop, {:shutdown, err}, nil}
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment