[ejabberd] thread safety of MUC restoration in a cluster

Evgeniy Khramtsov xramtsov at gmail.com
Sat Mar 5 05:15:32 MSK 2011


05.03.2011 02:48, Daniel Dormont wrote:
> I'm relatively new to Erlang, but I started looking at the code and the reason for my question is that it seems to me that since the route function in mod_muc executes a dirty read in muc_online_room (line 474) before creating and registering the new room, there's a chance for duplicate rooms being launched.
>    

Yes, there is a problem, you are right. But in fact, there will be no 
duplication, because the latest launch will overwrite the previous 
one(s). Fixing this requires a distributive transaction which is much 
worse (for scalability reason).

-- 
Regards,
Evgeniy Khramtsov, ProcessOne.
xmpp:xram at jabber.ru.



More information about the ejabberd mailing list