Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ex/Realtime.Server): use broadcast_local instead of broadcast #2856

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

firestack
Copy link
Member

@firestack firestack commented Oct 15, 2024

When we added distributed Elixir via DNSCluster in #2831, we started getting flickering data in our realtime sources. This was because we used a Phoenix.PubSub with the same name on both instances. Once instances were talking to eachother, those PubSub's started getting messages from other instances but the messages referenced non-existent information, which caused them to send null or empty [] information to clients when they received those messages.

Switching to broadcast_local for our Realtime.Server.broadcast/2 returns the code to it's previous assumptions where a message is only broadcasted to subscribers on the same node, which stopped instances from stepping on eachother.


@firestack firestack force-pushed the kf/fix/distributed-data-issue branch from fe2e3f0 to 44d479e Compare October 15, 2024 18:57
@firestack firestack marked this pull request as ready for review October 15, 2024 19:17
@firestack firestack requested a review from a team as a code owner October 15, 2024 19:17
Copy link
Collaborator

@hannahpurcell hannahpurcell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wooooo!!!

@firestack firestack merged commit 945a2e9 into main Oct 15, 2024
28 checks passed
@firestack firestack deleted the kf/fix/distributed-data-issue branch October 15, 2024 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants