[ejabberd] mnesia corruption with concurrent ejabberdctl usage
flatworm at users.sourceforge.net
Mon Dec 28 22:33:42 MSK 2009
On Mon, 28 Dec 2009 20:08:05 +0100
Martin Langhoff <martin.langhoff at gmail.com> wrote:
> - It is not safe to run many ejabberdctl instances because they
> always use the same "connection name"
> - If we give a truly random connection name, no overlaps happen, but
> erl will leak handles/processes/whatever
Not really. In fact the "atom table" of the Erlang emulator running
ejabberd server might eventually overflow.
> - So a small pool of names with some locking may work? Modern distros
> carry flock, so we could say (pseudo-shell):
> for CONNID in 1..$MAXCONNECTIONS; do
> if flock -n "$CONNLOCKDIR/ctl-ejabberd-$CONNID at localhost" \
> erl -sname "ctl-ejabberd-$CONNID at localhost" ... ; then
I think that the idea proposed by Brian Cully, namely to stick to
OS PIDs to generate unique names is OK.
Refer to discussions archived as  and .
Indeed, when preparing Debian package for 2.1.0, I implemented
a new command-line option for ejabberdctl, "--concurrent", which,
when specified turns on generation of unique node name for
the Erlang process started by ejabberdctl, and this unique name
is obtained by just appending the PID of the shell process
running ejabberdctl script to the node name.
Without the "--concurrent" command-line option, ejabberdctl
uses the same simple node name each time which is optimised for
manual runs of ejabberdctl. See  for details.
More information about the ejabberd