Skip to content

Commit

Permalink
Use exponential backoff when restoring a crashed replication connection
Browse files Browse the repository at this point in the history
Fixes #1960.
  • Loading branch information
alco committed Dec 13, 2024
1 parent 4c730f6 commit 80833b3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/sync-service/lib/electric/connection/manager.ex
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,9 @@ defmodule Electric.Connection.Manager do
"Handling the exit of the replication client #{inspect(pid)} with reason #{inspect(reason)}"
)

{:noreply, %{state | replication_client_pid: nil}, {:continue, :start_replication_client}}
state = %{state | replication_client_pid: nil}
state = schedule_reconnection(:start_replication_client, state)
{:noreply, state}
end

# The most likely reason for the lock connection or the DB pool to exit is the database
Expand Down

0 comments on commit 80833b3

Please sign in to comment.