[ejabberd] strange registration error

Jan Koum jan.koum at gmail.com
Mon Oct 26 22:21:20 MSK 2009


On Mon, Sep 21, 2009 at 1:53 AM, Badlop <badlop at gmail.com> wrote:

> 2009/9/18 Jan Koum <jan.koum at gmail.com>:
> > if i pass random/unique node name to ejabberdctl for registration,
> wouldn't
> > that break things with mnesia db when i start/stop nodes?
>
> Short answer: no problem with mnesia, but problem with infinite node names.
>
> Long answer:
> In ejabberd 2.1.0, the ejabberdctl script calls something like:
>  erl -sname ctl-ejabberd at localhost ...
>
> The problem with this is that you get the mentioned error if you try
> to execute an ejabberdctl command when the script is still running for
> a previous call.
>
> As the node name of this erl node is not important, you could edit the
> script and add a random part.
> Quick example:
>  NUM=`date +%s`
>  erl -sname ctl-$NUM-ejabberd at localhost ...
>
> The problem with this is not related to Mnesia.
>
> But a problem appears if you periodically call this script: each time
> you call it, ejabberdctl connects to the long-lasting ejabberd node
> with a different node name. Those names are stored temporarily in the
> node, and RAM consumption increases very slowly. Imagine 1 call every
> minute * a few weeks of rrdtool callings --> problem.
>
> A solution is to use a pseudo-random value: restricted to a small
> amount of values that repeat periodically.
> Quick example in Bash:
>  MINUTE=`date +%M`
>  SECOND=`date +%S`
>  PNUM=$[ $MINUTE + $SECOND ]
>  erl -sname ctl-$PNUM-ejabberd at localhost ...
>
> I suspect this solution is not yet good enough for inclusion in main
> ejabberd, so suggestions are welcomed.
>


on freebsd i am using jot(1) -- seems to work so far:

# common control function
RANDOM=`jot -r 1 1 100`
ctl ()
{
    COMMAND=$@
    $EXEC_CMD "$ERL \
      $NAME ctl-${RANDOM}-${ERLANG_NODE} \

-- yan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20091026/5edbc7ca/attachment.html>


More information about the ejabberd mailing list