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

Matthew Dempsky matthew@REDACTED
Fri Apr 11 12:02:10 CEST 2008


On Fri, Apr 11, 2008 at 1:40 AM, Hans Bolinder
<hans.bolinder@REDACTED> wrote:
>  It seems that pg2:leave() assumes that the pid is a member of the
>  group. The patch below should solve that problem ('ok' is returned if
>  the group exists but the pid is not a member of the group).

Ah, good find.

I'm curious though, in one of the gen_servers affected, in the
module's init/1 we call pg2:create(?GROUP) and then pg2:join(?GROUP,
self()), but then we never call pg2:leave (leaving it to pg2 to clean
up if the process crashes).  How would this issue affect this server?

Looking at the R12B-1 Erlang source, the only module that uses pg2 is
disk_log_sup.  Looking at modules in OTP that mention disk_log, the
only one that might possibly affect us is mnesia, but the above
described server process only uses mnesia:dirty_read and only on a
ram_copies table.  (It also updates this table, but only indirectly by
cast'ing a request to another gen_server to handle it.)

It would seem like either mnesia's disk_log usage is broken or there's
another pg2 bug to be discovered. :(



More information about the erlang-bugs mailing list