[Dovecot] 2nd postgresql server to connect when 1st fail

Timo Sirainen tss at iki.fi
Thu Aug 18 19:32:03 EEST 2005

On 17.8.2005, at 12:58, Krzysztof A. Adamski wrote:

>> I suppose that will work.. :) Of course that means that for failed
>> authentications it asks from both of the servers then.
> It will be enough for start i think. But how long will it take to
> decide that 2nd database should be used (i mean. how big is timeout
> for database connection?).

There is no timeout currently, so it takes as long as connect() takes 
to succeed or fail. If the database really is down and the TCP 
connection just gets refused, it's aborted immediately. If the database 
accepts the TCP connection but doesn't answer anything to requests, 
it's longer. There are no timeouts implemented currently so I guess 
it'll wait forever..

> And.. maybe there is a way to do something
> similiar in 0.99.14 ? I dont need really great solution but buckup
> connection if main wont work. Problems with first database shouldn't
> take too long so 2nd server will always be only temporary solution.
> I just need something like:
> if(!conect_to_db(host1))
> {	
> 	if(!connect_to_db(host2))
> 	{
> 		error
> 	}
> }

I guess something like that could work. The code is implemented 
asynchronously so it's not that simple, but probably not too difficult.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20050818/646b3cea/PGP.pgp

More information about the dovecot mailing list