Skip to content

Commit 6d02e18

Browse files
committed
fix: handle :system_not_started error in cluster restart
When Ra system hasn't been initialized on a node yet, :ra.stop_server returns {:error, :system_not_started} which wasn't being handled, causing a TryClauseError. Added case clause to handle :system_not_started and skip the stop operation gracefully. The start_server call will still work to initialize the cluster.
1 parent 922c8f5 commit 6d02e18

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/cluster_connect.exs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ defmodule ClusterHelper do
6262
{:error, :not_started} ->
6363
IO.puts("⚠ Ra server was not started")
6464

65+
{:error, :system_not_started} ->
66+
IO.puts("⚠ Ra system not started yet, skipping stop")
67+
6568
error ->
6669
IO.puts("⚠ Stop server returned: #{inspect(error)}")
6770
end

0 commit comments

Comments
 (0)