diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2014-08-20 11:53:23 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2014-08-20 11:53:23 +0100 |
commit | e039c90768ea78e9deed108b72702dba49ef0302 (patch) | |
tree | c8da832ac81a897b0a4caa3732c87e17f0305764 | |
parent | 7983305bf14d846774c37ca67dcf6ac1c88474b9 (diff) | |
download | rabbitmq-server-bug25813.tar.gz |
Fix a race.bug25813
-rw-r--r-- | src/pg_local.erl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pg_local.erl b/src/pg_local.erl index dc6401ca..4d9914d9 100644 --- a/src/pg_local.erl +++ b/src/pg_local.erl @@ -84,7 +84,13 @@ get_members(Name) -> in_group(Name, Pid) -> ensure_started(), - member_present(Name, Pid). + %% The join message is a cast and thus can race, but we want to + %% keep it that way to be fast in the common case. + case member_present(Name, Pid) of + true -> true; + false -> sync(), + member_present(Name, Pid) + end. sync() -> ensure_started(), |