diff --git a/.changeset/warm-brooms-approve.md b/.changeset/warm-brooms-approve.md new file mode 100644 index 0000000000..d4d4c14ff1 --- /dev/null +++ b/.changeset/warm-brooms-approve.md @@ -0,0 +1,5 @@ +--- +"@core/sync-service": patch +--- + +Log error but don't fall over if failing to initialise recovered shape diff --git a/packages/sync-service/lib/electric/shape_cache.ex b/packages/sync-service/lib/electric/shape_cache.ex index 2dbf0602e1..fdfe7895b7 100644 --- a/packages/sync-service/lib/electric/shape_cache.ex +++ b/packages/sync-service/lib/electric/shape_cache.ex @@ -318,7 +318,11 @@ defmodule Electric.ShapeCache do state.shape_status_state |> state.shape_status.list_shapes() |> Enum.each(fn {shape_handle, shape} -> - {:ok, _pid, _snapshot_xmin, _latest_offset} = start_shape(shape_handle, shape, state) + try do + {:ok, _pid, _snapshot_xmin, _latest_offset} = start_shape(shape_handle, shape, state) + rescue + e -> Logger.error("Failed to recover shape #{shape_handle}: #{inspect(e)}") + end end) end