You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by rj...@apache.org on 2008/01/07 20:41:46 UTC

svn commit: r609757 - in /tomcat/connectors/trunk/jk/native: apache-1.3/mod_jk.c apache-2.0/mod_jk.c common/jk_service.h common/jk_util.c iis/jk_isapi_plugin.c netscape/jk_nsapi_plugin.c

Author: rjung
Date: Mon Jan  7 11:41:44 2008
New Revision: 609757

URL: http://svn.apache.org/viewvc?rev=609757&view=rev
Log:
Remove "retries" element from service struct, because
we don't use it.

Modified:
    tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
    tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
    tomcat/connectors/trunk/jk/native/common/jk_service.h
    tomcat/connectors/trunk/jk/native/common/jk_util.c
    tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c
    tomcat/connectors/trunk/jk/native/netscape/jk_nsapi_plugin.c

Modified: tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c?rev=609757&r1=609756&r2=609757&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c Mon Jan  7 11:41:44 2008
@@ -2166,8 +2166,6 @@
             wc_maintain(conf->log);
             jk_init_ws_service(&s);
 
-            /* Update retries for this worker */
-            s.retries = worker->retries;
             s.ws_private = &private_data;
             s.pool = &private_data.p;
             ap_table_setn(r->notes, JK_NOTE_WORKER_TYPE,

Modified: tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c?rev=609757&r1=609756&r2=609757&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c Mon Jan  7 11:41:44 2008
@@ -2251,8 +2251,6 @@
             wc_maintain(xconf->log);
 
             jk_init_ws_service(&s);
-            /* Update retries for this worker */
-            s.retries = worker->retries;
             s.ws_private = &private_data;
             s.pool = &private_data.p;
             apr_table_setn(r->notes, JK_NOTE_WORKER_TYPE,

Modified: tomcat/connectors/trunk/jk/native/common/jk_service.h
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_service.h?rev=609757&r1=609756&r2=609757&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_service.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_service.h Mon Jan  7 11:41:44 2008
@@ -208,10 +208,6 @@
     jk_msg_buf_t *reco_buf;
     int reco_status;
 
-    /* Number of retries. Defaults to JK_RETRIES
-     */
-    int retries;
-
     /*
      * If set call flush after each write
      */

Modified: tomcat/connectors/trunk/jk/native/common/jk_util.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_util.c?rev=609757&r1=609756&r2=609757&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_util.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_util.c Mon Jan  7 11:41:44 2008
@@ -1865,7 +1865,6 @@
     s->secret = NULL;
     s->reco_buf = NULL;
     s->reco_status = RECO_NONE;
-    s->retries = JK_RETRIES;
     s->flush_packets = JK_FALSE;
     s->flush_header = JK_FALSE;
     s->response_started = JK_FALSE;

Modified: tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c?rev=609757&r1=609756&r2=609757&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c (original)
+++ tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c Mon Jan  7 11:41:44 2008
@@ -1506,8 +1506,6 @@
 
             if (worker) {
                 jk_endpoint_t *e = NULL;
-                /* Update retries for this worker */
-                s.retries = worker->retries;
                 if (worker->get_endpoint(worker, &e, logger)) {
                     int is_error = JK_HTTP_SERVER_ERROR;
                     int result;

Modified: tomcat/connectors/trunk/jk/native/netscape/jk_nsapi_plugin.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/netscape/jk_nsapi_plugin.c?rev=609757&r1=609756&r2=609757&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/netscape/jk_nsapi_plugin.c (original)
+++ tomcat/connectors/trunk/jk/native/netscape/jk_nsapi_plugin.c Mon Jan  7 11:41:44 2008
@@ -380,7 +380,6 @@
 
         s.ws_private = &private_data;
         s.pool = &private_data.p;
-        s.retries = worker->retries;
 
         wc_maintain(logger);
         if (init_ws_service(&private_data, &s)) {



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


Re: svn commit: r609757 - in /tomcat/connectors/trunk/jk/native: apache-1.3/mod_jk.c apache-2.0/mod_jk.c common/jk_service.h common/jk_util.c iis/jk_isapi_plugin.c netscape/jk_nsapi_plugin.c

Posted by Mladen Turk <mt...@apache.org>.
Rainer Jung wrote:
> Hi Mladen, I found it :)
> 
> 
> It was like that in 1.2.15. Then in July 2006, shortly before 1.2.18 you 
> changed that:
> 

I knew it ;)
I even know why I changed that, but that's another story.
Nevertheless, sorry for the noise.

Regards,
Mladen



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


Re: svn commit: r609757 - in /tomcat/connectors/trunk/jk/native: apache-1.3/mod_jk.c apache-2.0/mod_jk.c common/jk_service.h common/jk_util.c iis/jk_isapi_plugin.c netscape/jk_nsapi_plugin.c

Posted by Rainer Jung <ra...@kippdata.de>.
Hi Mladen, I found it :)

Mladen Turk schrieb:
> Rainer Jung wrote:
>> Mladen Turk wrote:
>>> Rainer Jung wrote:
>>>>
>>>> Does that make sense for you?
>>>>
>>>
>>> Yes it does. The most important is that if
>>> there was no retries set for ajp worker, it gets copied
>>> from lb worker.
>>
>> In fact we don't copy (this is not new), because the retries for an lb 
>> has a different functional meaning than for an lb sub worker. If an 
>> ajp worker (main worker or lb sub worker) doesn't have a retries set, 
>> it gets the default value JK_RETRIES (=2).
>>
> 
> Hmm, I think the elected worker in mod_jk was setting the service's
> retries, and then service was setting particular real workers retries.
> 
> I'm almost sure each worker inherited the retries from
> lb (at least it should).

It was like that in 1.2.15. Then in July 2006, shortly before 1.2.18 you 
changed that:

http://svn.apache.org/viewvc?view=rev&revision=420265

 From that change on, the retries element in the service struct was no 
more used. We set it, but didn't read from it anywhere.

Since retries for an lb worker does something different, than for an lb 
ajp member worker, I find the situation to keep them separate fine.

At least my recent commit doesn't change the situation we had since 1.5 
years :)

Regards,

Rainer

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


Re: svn commit: r609757 - in /tomcat/connectors/trunk/jk/native: apache-1.3/mod_jk.c apache-2.0/mod_jk.c common/jk_service.h common/jk_util.c iis/jk_isapi_plugin.c netscape/jk_nsapi_plugin.c

Posted by Mladen Turk <mt...@apache.org>.
Rainer Jung wrote:
> Mladen Turk wrote:
>> Rainer Jung wrote:
>>>
>>> Does that make sense for you?
>>>
>>
>> Yes it does. The most important is that if
>> there was no retries set for ajp worker, it gets copied
>> from lb worker.
> 
> In fact we don't copy (this is not new), because the retries for an lb 
> has a different functional meaning than for an lb sub worker. If an ajp 
> worker (main worker or lb sub worker) doesn't have a retries set, it 
> gets the default value JK_RETRIES (=2).
> 

Hmm, I think the elected worker in mod_jk was setting the service's
retries, and then service was setting particular real workers retries.

I'm almost sure each worker inherited the retries from
lb (at least it should).

Regards,
Mladen

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


Re: svn commit: r609757 - in /tomcat/connectors/trunk/jk/native: apache-1.3/mod_jk.c apache-2.0/mod_jk.c common/jk_service.h common/jk_util.c iis/jk_isapi_plugin.c netscape/jk_nsapi_plugin.c

Posted by Rainer Jung <ra...@kippdata.de>.
Mladen Turk wrote:
> Rainer Jung wrote:
>>
>> Does that make sense for you?
>>
> 
> Yes it does. The most important is that if
> there was no retries set for ajp worker, it gets copied
> from lb worker.

In fact we don't copy (this is not new), because the retries for an lb 
has a different functional meaning than for an lb sub worker. If an ajp 
worker (main worker or lb sub worker) doesn't have a retries set, it 
gets the default value JK_RETRIES (=2).

> Regards,
> Mladen

Regards,

Rainer

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


Re: svn commit: r609757 - in /tomcat/connectors/trunk/jk/native: apache-1.3/mod_jk.c apache-2.0/mod_jk.c common/jk_service.h common/jk_util.c iis/jk_isapi_plugin.c netscape/jk_nsapi_plugin.c

Posted by Mladen Turk <mt...@apache.org>.
Rainer Jung wrote:
> 
> Does that make sense for you?
>

Yes it does. The most important is that if
there was no retries set for ajp worker, it gets copied
from lb worker.

Regards,
Mladen

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


Re: svn commit: r609757 - in /tomcat/connectors/trunk/jk/native: apache-1.3/mod_jk.c apache-2.0/mod_jk.c common/jk_service.h common/jk_util.c iis/jk_isapi_plugin.c netscape/jk_nsapi_plugin.c

Posted by Rainer Jung <ra...@kippdata.de>.
Mladen Turk schrieb:
> rjung@apache.org wrote:
>> Author: rjung
>> Date: Mon Jan  7 11:41:44 2008
>> New Revision: 609757
>>
>> URL: http://svn.apache.org/viewvc?rev=609757&view=rev
>> Log:
>> Remove "retries" element from service struct, because
>> we don't use it.
>>
> 
> I don't get it.
> This copy was intentionally made so we can pass the
> retries from lb to each worker, meaning that if you
> set the retries to the lb it'll be propagated to each
> worker that is member of this lb, allowing to set the
> retries only once.

But that's not what the code does, see below. The retries in the lb and 
in the members serve a different and independant purpose. Of course it 
would have been nice to give those different names and then inherit from 
lb to the members, but we can't change the meaning of the parameters 
now. See details below.

> Can you explain this patch?

Yes. We had "retries" in three places:

A) in the service struct
B) in the lb_worker struct
C) in the jk_worker struct

Ad A)

The element retries in the service struct was set in the web server 
plugins to JK_RETRIES, but never read. It was not used in any place.

Ad B)

The retries in the lb_worker is the number of times we try to get and 
endpoint from the cache. For Apache with default settings, this should 
be noop, because we have as many endpoints as we have threads, for IIS 
and netscape, this will wait a bit and retry to get a free endpoint.

The value gets set during lb initialization and is read from the 
workers.properties, attribite retries of the lb worker itself.

Ad C)

The retries in jk_worker is set in all types of workers (status, jni, 
ajp12, ajp13, ajp14) but only used in ajp13 and ajp14. Therefore I moved 
it from jk_worker to ajp_worker, because that's a good fit.

The value gets set during ajp worker initialization rom the retries 
attribute of the ajp worker (or lb member). It is independent from the 
retries on any lb.

It gets used, when the service call of the worker gets an error, e.g. if 
all connections are dead.

Does that make sense for you?

Regards,

Rainer

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


Re: svn commit: r609757 - in /tomcat/connectors/trunk/jk/native: apache-1.3/mod_jk.c apache-2.0/mod_jk.c common/jk_service.h common/jk_util.c iis/jk_isapi_plugin.c netscape/jk_nsapi_plugin.c

Posted by Mladen Turk <mt...@apache.org>.
rjung@apache.org wrote:
> Author: rjung
> Date: Mon Jan  7 11:41:44 2008
> New Revision: 609757
> 
> URL: http://svn.apache.org/viewvc?rev=609757&view=rev
> Log:
> Remove "retries" element from service struct, because
> we don't use it.
>

I don't get it.
This copy was intentionally made so we can pass the
retries from lb to each worker, meaning that if you
set the retries to the lb it'll be propagated to each
worker that is member of this lb, allowing to set the
retries only once.

Can you explain this patch?

Regards,
Mladen



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