You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I connect a new node to the cluster, I get a bunch of messages like this:
2023-05-12T13:32:44.260Z pid=<0.4030.0> [error] MySubscriber received unexpected message: {:swarm, :die}
I am using CommandedSwarmRegistry.
AFAIU, Subscribers start on both nodes, and when the nodes connect, Swarm kills half of the subscribers on one node and half on the other so that each subscriber runs only once.
Only slightly: in the sense that it requires adding some more clauses to handle_info in the same place.
AFAIU, swarm does not send exit signals to other processes the same way as global registry does.
Instead, it sends messages and expects the process to be aware that it is managed by Swarm and react to those accordingly. https://github.com/bitwalker/swarm#example
def handle_info({:swarm, :die}, state) do
{:stop, :shutdown, state}
end
If Commanded wants to support swarm, we would need add handling of those messages to all process managed via the abstract Registry that can be resolved to either :global or :swarm
When I connect a new node to the cluster, I get a bunch of messages like this:
I am using CommandedSwarmRegistry.
AFAIU, Subscribers start on both nodes, and when the nodes connect, Swarm kills half of the subscribers on one node and half on the other so that each subscriber runs only once.
However, when reading the code, I saw that this message is logged, but the Event.Handler is not terminated.
https://github.com/commanded/commanded/blob/master/lib/commanded/event/handler.ex#L826
Is the consensus that Swarm is an officially supported registry? Then I could add handling of this and potentially other swarm messages.
The text was updated successfully, but these errors were encountered: