I also added it to the other mysql connect calls (2 others).

Is the timeout value in seconds? Maybe we should give it
more than 1 second to connect. Perhaps 3?

Ken Jones

On Wednesday 04 June 2003 10:01 am, matthew berardi wrote:
> I don't know how many people would desire this behaviour. but I think it
> should be considered.
> in vmysql.c I added the following lines to vauth_open_update()
> uint timeout = 1;
> mysql_options(&mysql_update, MYSQL_OPT_CONNECT_TIMEOUT, (char*) &timeout);
> this adds a timeout to the mysql_real_connect method.
> without this libmysqlclient uses the standard connect() to connect
> which, under heavy load, can take minutes to timeout, the effect is that
> if the update server was to become unavailable your pop concurency would
> max out very quickly, effectively a loss of service.
> also you would want to remove the error lines:
> fprintf(stderr, "could not connect to mysql update server %s with
> database\n", mysql_error(&mysql_update));
> and
> fprintf(stderr, "could not connect to mysql update server %s\n",
>               mysql_error(&mysql_update));
> because some pop clients break if they receive anything other than the
> ok after auth.

Reply via email to