[erlang-questions] pg2 still busted in R13B04

Hans Bolinder hans.bolinder@REDACTED
Thu May 27 13:22:20 CEST 2010


[Rick Pettit:]
> A while ago someone had posted that pg2 appeared to be broken as of R13B03.
> 
> I am doing some testing with R13B04, and am finding the same to be true.
> 
> Namely, with R13B04, it is possible for the same process to appear in a
> group many times (even if that process only added itself once). This leads
> to all sorts of problems, and makes it impossible to use pg2 with this
> release.

Could you please try the following patch? 

The patch should correct one bug introduced in R13B03.

Best regards,

Hans Bolinder, Erlang/OTP team, Ericsson

--- /usr/local/otp/releases/otp_beam_linux_sles10_x64_r13b_latest/lib/kernel-2.13.5.1/src/pg2.erl	2010-03-09 12:45:05.000000000 +0100
+++ /clearcase/otp/erts/lib/kernel/src/pg2.erl	2010-05-27 12:53:02.000000000 +0200
@@ -251,7 +251,9 @@
 %%%    Pid is a member of group Name.

 store(List) ->
-    _ = [assure_group(Name) andalso [join_group(Name, P) || P <- Members] ||
+    _ = [(assure_group(Name)
+          andalso
+          [join_group(Name, P) || P <- Members -- group_members(Name)]) ||
             [Name, Members] <- List],
     ok.


More information about the erlang-questions mailing list