tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mladen Turk <mt...@apache.org>
Subject Re: svn commit: r701507 - in /tomcat/connectors/trunk/jk/native/common: jk_ajp_common.c jk_ajp_common.h jk_util.c jk_util.h
Date Sat, 04 Oct 2008 06:48:42 GMT
rjung@apache.org wrote:
> Author: rjung
> Date: Fri Oct  3 12:37:13 2008
> New Revision: 701507
> 
> URL: http://svn.apache.org/viewvc?rev=701507&view=rev
> Log:
> Add retry_wait for AJP13 workers.
> If a request fails, sleep a configurable time
> before each following retry.
> Remember: this has nothing to do with the lb retries.
> 
> +    retry_wait = p->worker->retry_wait;
>      for (i = 0; i < aw->retries; i++) {
>          /*
> +         * ajp_send_request() already locally handles
> +         * reconnecting and broken connection detection.
> +         * So if we already failed in it, wait a bit before
> +         * retrying the same backend.
> +         */
> +        if (i > 0 && retry_wait >= 0) {
> +            if (JK_IS_DEBUG_LEVEL(l))
> +                jk_log(l, JK_LOG_DEBUG,
> +                       "retry %d, sleeping for %d ms before retrying",
> +                       i, retry_wait);
> +            jk_sleep(retry_wait);
> +        }
> +        /*

Nice!
Although I'd change retry_wait to retry_interval.

I was thinking to use the retry_wait as absolute timeout
instead 'retries * retry_interval',
with some default step value (as inside lb
with JK_LB_MIN_RETRY_WAIT/JK_LB_MAX_RETRY_WAIT)

This would behave like:
Retry worker 'x' until retry_wait expires.
It would calculate the time spend in accessing
the network as well, and give the real timeout.
Right now we have sleep, but between them network
might introduce variable delays as well.

The same should be applied to load_balancer so that
we can exactly know how much time we'll wait for free
endpoint. So use retry_wait as a limit for retry
steps (they don't need to be configurable there)
Right now for lb we need insane high values for
retries (100 for 10 second wait on free cache entry)

Then retries would be used for their real purpose.

Regards
-- 
^(TM)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message