[erlang-questions] [erlang-bugs] Weird pg2 behavior

Matthew Dempsky <>
Tue Apr 15 21:41:37 CEST 2008

On Mon, Apr 14, 2008 at 12:21 AM, Hans Bolinder
<> wrote:
>  I've tried to find more bugs, but so far without success.

I think I came up with a race condition scenario for pg2:

Node1 and Node2 are running and communicating.
Pid is on Node1, and a member of pg2 group Group.
Node3 starts up and connects to Node2 first.
Node3 and Node2's pg2 processes exchange their group tables,
and Node3 ends up with Pid in the Group table.
Node1 goes down before Node3 connects to it.
A nodedown message is sent to Node2, who clears Pid from Group.
Node1 restarts and exchanges group tables with Node2 and Node3 again,
and Pid remains in the Group table.

I'm thinking a possible solution would be when a pg2 process receives
a {nodeup, Node} message, it first removes all pids from Node in its
ets tables and relies on the exchange to reinstate them.

More information about the erlang-questions mailing list