| Author |
Message |
|
| Guest |
Posted: Fri Sep 18, 2009 2:42 am |
|
|
|
Guest
|
hi there,
in most cases when user with the same name re-registers (which our custom software allows and gracefully fails), we get a "normal" error like:
17/Sep/2009:19:35:22 SOFTFAIL command: [/home/jkoum/ejabberd-2.1.0_beta1/bin/ejabberdctl register xxx xxx@s.example.net (xxx@s.example.net) already registered at node ejabberd@localhost
and sometimes we get a nasty scary error like:
17/Sep/2009:15:27:36 HARDFAIL command: [/home/jkoum/ejabberd-2.1.0_beta1/bin/ejabberdctl register xxx s.example.net yyy] return: 1 {error_logger,{{2009,9,17},{15,27,33}},"Protocol: ~p: register error: ~p~n",["inet_tcp",{{badmatch,{error,duplicate_name}},[{inet_tcp_dist,listen,1},{net_kernel,start_protos,4},{net_kernel,start_protos,3},{net_kernel,init_node,2},{net_kernel,init,1},{gen_server,init_it,6},{proc_lib,init_p,5}]}]}
while end result is the same, i am curious if this different behavior is normal or is this some bug we are triggering?
-- yan
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Fri Sep 18, 2009 10:55 am |
|
|
|
Guest
|
Jan Koum wrote:
> 17/Sep/2009:15:27:36 HARDFAIL command:
> [/home/jkoum/ejabberd-2.1.0_beta1/bin/ejabberdctl register xxx
> s.example.netyyy] return: 1
> {error_logger,{{2009,9,17},{15,27,33}},"Protocol: ~p:
> register error:
> ~p~n",["inet_tcp",{{badmatch,{error,duplicate_name}},[{inet_tcp_dist,listen,1},{net_kernel,start_protos,4},{net_kernel,start_protos,3},{net_kernel,init_node,2},{net_kernel,init,1},{gen_server,init_it,6},{proc_lib,init_p,5}]}]}
>
> while end result is the same, i am curious if this different behavior is
> normal or is this some bug we are triggering?
This error has nothing to do with user registration,
at least not directly. See [1] for explanations.
1. http://www.ejabberd.im/error/duplicate_name
_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Fri Sep 18, 2009 4:07 pm |
|
|
|
Guest
|
i looked at the url but still a bit confused... it says you get this error when trying to start another instance of ejabberd, but i am not starting another instance of ejabberd, just trying to register a user..
-- yan
On Fri, Sep 18, 2009 at 3:55 AM, Konstantin Khomoutov <flatworm@users.sourceforge.net (flatworm@users.sourceforge.net)> wrote:
Quote: Jan Koum wrote:
Quote: 17/Sep/2009:15:27:36 HARDFAIL command:
[/home/jkoum/ejabberd-2.1.0_beta1/bin/ejabberdctl register xxx
s.example.netyyy] return: 1
{error_logger,{{2009,9,17},{15,27,33}},"Protocol: ~p:
register error:
~p~n",["inet_tcp",{{badmatch,{error,duplicate_name}},[{inet_tcp_dist,listen,1},{net_kernel,start_protos,4},{net_kernel,start_protos,3},{net_kernel,init_node,2},{net_kernel,init,1},{gen_server,init_it,6},{proc_lib,init_p,5}]}]}
while end result is the same, i am curious if this different behavior is
normal or is this some bug we are triggering?
This error has nothing to do with user registration,
at least not directly. See [1] for explanations.
1. http://www.ejabberd.im/error/duplicate_name
_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru (ejabberd@jabber.ru)
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Fri Sep 18, 2009 5:31 pm |
|
|
|
Guest
|
Jan Koum wrote:
>> 17/Sep/2009:15:27:36 HARDFAIL command:
>>> [/home/jkoum/ejabberd-2.1.0_beta1/bin/ejabberdctl register xxx
>>> s.example.netyyy] return: 1
>>> {error_logger,{{2009,9,17},{15,27,33}},"Protocol: ~p:
>>> register error:
>>>
>>> ~p~n",["inet_tcp",{{badmatch,{error,duplicate_name}},[{inet_tcp_dist,listen,1},{net_kernel,start_protos,4},{net_kernel,start_protos,3},{net_kernel,init_node,2},{net_kernel,init,1},{gen_server,init_it,6},{proc_lib,init_p,5}]}]}
>>>
>>> while end result is the same, i am curious if this different behavior is
>>> normal or is this some bug we are triggering?
>>>
>> This error has nothing to do with user registration,
>> at least not directly. See [1] for explanations.
>>
>> 1. http://www.ejabberd.im/error/duplicate_name
> i looked at the url but still a bit confused... it says you get this
> error when trying to start another instance of ejabberd, but i am not
> starting another instance of ejabberd, just trying to register
> a user..
The problem is possibly not related to starting *ejabberd itself*
multiple times, but rather to staring two or more instances of
ejabberdctl at the same time.
My guess goes like this: ejabberdctl is a Unix shell script script which
ends up calling the Erlang emulator to run the ejabberd_ctl module after
setting up the environment for this. The erl process is run with either
the -name or the -sname flag which turns the process into a distributed
Erlang node (see [1]). Since Erlang nodes must be unique across their
network, the Erlang subsystem will not let you run more than one node
with the same name/short name. So if you have a race between ejabberdctl
runs, the second one will fail.
You can easily see how this occurs:
$ erl -sname foo &
$ erl -sname foo
(see it crash, scroll up to see that badmatch error)
$ rm erl_crash.dump
$ fg
(press ctrl-g, then enter q and hit return)
The solution could be to modify the ejabberdctl code to make random (or
predictably unique) node name for -name/-sname.
1. http://www.erlang.org/doc/man/erl.html
P.S.
Please, don't top-post, see
http://www.catb.org/~esr/jargon/html/T/top-post.html
_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Fri Sep 18, 2009 5:37 pm |
|
|
|
Guest
|
On Fri, Sep 18, 2009 at 10:31 AM, Konstantin Khomoutov <flatworm@users.sourceforge.net (flatworm@users.sourceforge.net)> wrote:
|
|
|
| Back to top |
|
| Guest |
Posted: Fri Sep 18, 2009 5:57 pm |
|
|
|
Guest
|
Jan Koum wrote:
>> 17/Sep/2009:15:27:36 HARDFAIL command:
>>>>> [/home/jkoum/ejabberd-2.1.0_beta1/bin/ejabberdctl register xxx
>>>>> s.example.netyyy] return: 1
>>>>> {error_logger,{{2009,9,17},{15,27,33}},"Protocol: ~p:
>>>>> register error:
>>>>> ~p~n",["inet_tcp",{{badmatch,{error,duplicate_name}},[{inet_tcp_dist,listen,1},{net_kernel,start_protos,4},{net_kernel,start_protos,3},{net_kernel,init_node,2},{net_kernel,init,1},{gen_server,init_it,6},{proc_lib,init_p,5}]}]}
[...]
>> The problem is possibly not related to starting *ejabberd itself*
>> multiple times, but rather to staring two or more instances of ejabberdctl
>> at the same time.
[...]
> lol.. all of sudden i get flashbacks of usenet circa 1996:) what about
> in-line responses?
Mailing lists are not much different from Usenet (which is alive and
kicking by the way), and after all, this list is indexed by google so
let's help those who will google for your problem by constructing easily
readable e-mails. I hope you did not get too tired pressing ctrl-end in
your editor before answering, right?
> anyways, yes you are correct -- it is a race condition. i added random
> sleep/wait for the script to retry if it detects a collision with another
> ejabberdctl.
>
> if i pass random/unique node name to ejabberdctl for registration, wouldn't
> that break things with mnesia db when i start/stop nodes?
I wouldn't swear that it won't as I have no experience with clustered
ejabberd setup, but I see no reason for complications to happen:
ejabberdctl's nodes are not supposed to be contacted by other nodes --
they are "client only" nodes.
_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Mon Sep 21, 2009 8:53 am |
|
|
|
Guest
|
2009/9/18 Jan Koum <jan.koum@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@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@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@localhost ...
I suspect this solution is not yet good enough for inclusion in main
ejabberd, so suggestions are welcomed.
---
Badlop
ProcessOne
_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Mon Sep 21, 2009 10:47 am |
|
|
|
Guest
|
Badlop wrote:
[...]
> 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@localhost ...
>
> I suspect this solution is not yet good enough for inclusion in main
> ejabberd, so suggestions are welcomed.
Just copy the solution from Debian -- it uses nanoseconds to greatly
lower the chances of a race condition.
_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post received from mailinglist |
|
|
| Back to top |
|
| wuji |
Posted: Mon Aug 13, 2012 7:18 am |
|
|
|
User
Joined: 10 Aug 2012
Posts: 654
|
Anderson has ordered a review of police response to the the imitation designer *beep* the incident.Luther was remembered as an "awesome guy" and was
well loved," Jay Allis, the kitchen manager at the restaurant, restaurant, cheap polo shirts restaurant, told ABC News' Nashville affiliate WKRN.A recording at the
East Cafe said it would remain closed for "an indeterminate indeterminate jordan 6s indeterminate amount of time due to a tragedy in out
Cafe family."Police Pursuits in California Have Injured More Than 10,000Nearly 10,000Nearly jordan 6 10,000Nearly 90 Percent of Pursuits are for Non-Violent OffensesBy DAVID
19, 2012 More bystanders are injured or killed during high-speed high-speed [h3]cheap polo ralph lauren[/h3] high-speed police chases than by stray bullets. In California, more
10,000 people have been injured and over 300 people killed killed [h4]cheap designer *beep*[/h4] killed because of police chases in the last decade, according
newly released statistics from the California Highway Patrol.Nationally, it's estimated estimated [h2]jordan 6[/h2] estimated nearly 300 people die each year as a result |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|