Erlang Mailing Lists

Author Message

<  Ejabberd mailing list  ~  Disconnection from mysql database...

Guest
Posted: Tue Oct 31, 2006 5:48 pm Reply with quote
Guest
Hi everyone,

I've downloaded the latest release of ejabberd (1.1.2) and installed it on
Redhat ES4. Im actually having some problems with ejabberd because it gets
disconnected silently from the database and if it tries to access it again,
instead of establishing a new connection it will simply tell that cannot
connect.

This problem happens cause i have 2 mysql databases installed working in
clusterdb mode and load-balanced with keepalived. Keepalived has a 15 minute
persistence timeout but if in those 15 minutes the ejabberd server doesn't
talk to the database keepalived will drop the connection. Then ejabberd when
needs access to the DB connects again to the load balancer and sees the
connection was closed, it just fails, he doesn't try to connect again.

Is something im missing ?

I tried putting the persistence timeout to 60 minutes but this only will
delay the issue.

Any thoughts will be appreciated.

Kind Regards,

Adrian Almenar


_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post recived from mailinglist
Guest
Posted: Fri Nov 03, 2006 11:53 am Reply with quote
Guest
I have been checking and i found on mysql_conn.erl:

fetch(Pid, Query, From) ->
fetch(Pid, Query, From, ?DEFAULT_STANDALONE_TIMEOUT).

fetch(Pid, Query, From, Timeout) when is_pid(Pid), is_list(Query) ->
Self = self(),
Pid ! {fetch, Query, From},
case From of
Self ->
%% We are not using a mysql_dispatcher, await the response
receive
{fetch_result, Pid, Result} ->
Result
after Timeout ->
{error, "query timed out"}
end;
_ ->
%% From is gen_server From, Pid will do gen_server:reply() when
it has an answer
ok
end.

The problem I explained on the email after happens because it gets a
Timeout, I traced it to the part where (error, "query timed out") gets
called. I don't know too much erlang to modify this function but if anyone
can help me or can guide me to where I can read so I can make it it will be
greatly appreciated. I think the correct way of working is if it gets a
timeout, try to close the old connection and start a new one.

You can see this happening by connecting an ejabberd server to a mysql
database server and putting an iptables rule avoiding all connections to
mysql port.

Kind Regards,

Adrian Almenar

-----Mensaje original-----
De: ejabberd-bounces@jabber.ru [mailto:ejabberd-bounces@jabber.ru] En nombre
de Adrian Almenar S.
Enviado el: martes, 31 de octubre de 2006 18:48
Para: ejabberd@jabber.ru
Asunto: [ejabberd] Disconnection from mysql database...

Hi everyone,

I've downloaded the latest release of ejabberd (1.1.2) and installed it on
Redhat ES4. Im actually having some problems with ejabberd because it gets
disconnected silently from the database and if it tries to access it again,
instead of establishing a new connection it will simply tell that cannot
connect.

This problem happens cause i have 2 mysql databases installed working in
clusterdb mode and load-balanced with keepalived. Keepalived has a 15 minute
persistence timeout but if in those 15 minutes the ejabberd server doesn't
talk to the database keepalived will drop the connection. Then ejabberd when
needs access to the DB connects again to the load balancer and sees the
connection was closed, it just fails, he doesn't try to connect again.

Is something im missing ?

I tried putting the persistence timeout to 60 minutes but this only will
delay the issue.

Any thoughts will be appreciated.

Kind Regards,

Adrian Almenar


_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd


_______________________________________________
ejabberd mailing list
ejabberd@jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

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