Skip to content

Commit 53c98c6

Browse files
authored
fix: use better key for node selection on regional broadcasting (#1585)
Using "worker" is not great because we can have a single worker if broacast_pool_size=1 Using self() will ensure that the selected node will vary as self() has a high cardinality
1 parent 9adde30 commit 53c98c6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/realtime/gen_rpc/pub_sub.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ defmodule Realtime.GenRpcPubSub do
5656
GenRpc.abcast(other_nodes, worker, Worker.forward_to_local(topic, message, dispatcher), key: worker)
5757

5858
# send a message to a node in each region to forward to the rest of the region
59-
other_region_nodes = nodes_from_other_regions(my_region, worker)
59+
other_region_nodes = nodes_from_other_regions(my_region, self())
6060

6161
GenRpc.abcast(other_region_nodes, worker, Worker.forward_to_region(topic, message, dispatcher), key: worker)
6262
else

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defmodule Realtime.MixProject do
44
def project do
55
[
66
app: :realtime,
7-
version: "2.56.0",
7+
version: "2.56.1",
88
elixir: "~> 1.18",
99
elixirc_paths: elixirc_paths(Mix.env()),
1010
start_permanent: Mix.env() == :prod,

0 commit comments

Comments
 (0)