You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by mt...@apache.org on 2009/02/19 16:28:48 UTC
svn commit: r745898 - in /tomcat/connectors/trunk/jk:
native/iis/jk_isapi_plugin.c xdocs/miscellaneous/changelog.xml
Author: mturk
Date: Thu Feb 19 15:28:47 2009
New Revision: 745898
URL: http://svn.apache.org/viewvc?rev=745898&view=rev
Log:
Update uriworkermap on watchog interval
Modified:
tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c
tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
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=745898&r1=745897&r2=745898&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c (original)
+++ tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c Thu Feb 19 15:28:47 2009
@@ -2377,6 +2377,11 @@
jk_log(logger, JK_LOG_DEBUG,
"Watchdog thread running");
}
+ if (worker_mount_file[0]) {
+ jk_shm_lock();
+ uri_worker_map_update(uw_map, 0, logger);
+ jk_shm_unlock();
+ }
wc_maintain(logger);
}
if (JK_IS_DEBUG_LEVEL(logger)) {
@@ -2499,10 +2504,11 @@
uw_map->reject_unsafe = 1;
else
uw_map->reject_unsafe = 0;
- uw_map->fname = worker_mount_file;
uw_map->reload = worker_mount_reload;
- if (worker_mount_file[0])
+ if (worker_mount_file[0]) {
+ uw_map->fname = worker_mount_file;
rc = uri_worker_map_load(uw_map, logger);
+ }
}
if (rc) {
rc = JK_FALSE;
Modified: tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml?rev=745898&r1=745897&r2=745898&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml Thu Feb 19 15:28:47 2009
@@ -44,6 +44,11 @@
<subsection name="Native">
<changelog>
<update>
+ IIS: Update uriworkermap.properies file on
+ a regular interval. This requires both worker_mount_reload
+ and watchog_interval to be defined. (mturk)
+ </update>
+ <update>
AJP: Allow changing worker address via jkstatus
manager. The address is resolved on next request
for that worker. (mturk)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: svn commit: r745898 - in /tomcat/connectors/trunk/jk: native/iis/jk_isapi_plugin.c
xdocs/miscellaneous/changelog.xml
Posted by Mladen Turk <mt...@apache.org>.
Rainer Jung wrote:
> On 25.02.2009 13:56, Mladen Turk wrote:
>> Rainer Jung wrote:
>>> On 19.02.2009 16:28, mturk@apache.org wrote:
>>>> Author: mturk
>>>> Date: Thu Feb 19 15:28:47 2009
>>>> New Revision: 745898
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=745898&view=rev
>>>> Log:
>>>> Update uriworkermap on watchog interval
>>>>
>>>> Modified:
>>>> tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c
>>>> tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
>>>>
>>>> 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=745898&r1=745897&r2=745898&view=diff
>>>>
>>>>
>>>> ==============================================================================
>>>>
>>>>
>>>> --- tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c (original)
>>>> +++ tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c Thu Feb
>>>> 19 15:28:47 2009
>>>> @@ -2377,6 +2377,11 @@
>>>> jk_log(logger, JK_LOG_DEBUG,
>>>> "Watchdog thread running");
>>>> }
>>>> + if (worker_mount_file[0]) {
>>>> + jk_shm_lock();
>>>> + uri_worker_map_update(uw_map, 0, logger);
>>>> + jk_shm_unlock();
>>>> + }
>>>
>>> Why the shm lock/unlock? The map itself has a lock that gets used. We
>>> don't use the shm lock around map_uri_to_worker_ext(), which also goes
>>> down to map_uri_to_worker_ext().
>>>
>>
>> Because IIS6+ can have multiple worker processes.
>> map lock is thread lock not shared across childs.
>
> But do those processes share the same map? It is not in shared memory,
> so each process should have it's own copy? Otherwise we would need to
> consider the same for Apache 2.x.
>
Well, perhaps the mutex lock is not needed. I just payed safe
to make sure the entire update transaction is atomic cause it
happens from the watchdog thread, and jk_shm_lock() is the
only api we have for that.
>
> Nevertheless: why is that needed for IIS? Isn't the map automatically
> reloaded if needed?
>
Yes, but on the first request. If we have a watchdog we can do that
in advance before there is an request.
Regards
--
^(TM)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: svn commit: r745898 - in /tomcat/connectors/trunk/jk: native/iis/jk_isapi_plugin.c
xdocs/miscellaneous/changelog.xml
Posted by Rainer Jung <ra...@kippdata.de>.
On 25.02.2009 13:56, Mladen Turk wrote:
> Rainer Jung wrote:
>> On 19.02.2009 16:28, mturk@apache.org wrote:
>>> Author: mturk
>>> Date: Thu Feb 19 15:28:47 2009
>>> New Revision: 745898
>>>
>>> URL: http://svn.apache.org/viewvc?rev=745898&view=rev
>>> Log:
>>> Update uriworkermap on watchog interval
>>>
>>> Modified:
>>> tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c
>>> tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
>>>
>>> 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=745898&r1=745897&r2=745898&view=diff
>>>
>>> ==============================================================================
>>>
>>> --- tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c (original)
>>> +++ tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c Thu Feb
>>> 19 15:28:47 2009
>>> @@ -2377,6 +2377,11 @@
>>> jk_log(logger, JK_LOG_DEBUG,
>>> "Watchdog thread running");
>>> }
>>> + if (worker_mount_file[0]) {
>>> + jk_shm_lock();
>>> + uri_worker_map_update(uw_map, 0, logger);
>>> + jk_shm_unlock();
>>> + }
>>
>> Why the shm lock/unlock? The map itself has a lock that gets used. We
>> don't use the shm lock around map_uri_to_worker_ext(), which also goes
>> down to map_uri_to_worker_ext().
>>
>
> Because IIS6+ can have multiple worker processes.
> map lock is thread lock not shared across childs.
But do those processes share the same map? It is not in shared memory,
so each process should have it's own copy? Otherwise we would need to
consider the same for Apache 2.x.
Also as I said, the same problem is already there, when
map_uri_to_worker_ext() gets called. It can also trigger a map reload
(as does the status worker).
>> Another thing: do you think it's useful to add this to Apache 2.0 too?
>> What's the reason for it (the map is automatically updated when a
>> request comes in).
>>
>
> Apache has graceful restart, so I doubt this makes sense.
Nevertheless: why is that needed for IIS? Isn't the map automatically
reloaded if needed?
>>> - uw_map->fname = worker_mount_file;
>>> uw_map->reload = worker_mount_reload;
>>> - if (worker_mount_file[0])
>>> + if (worker_mount_file[0]) {
>>> + uw_map->fname = worker_mount_file;
>>> rc = uri_worker_map_load(uw_map, logger);
>>> + }
>>
>> Moving the uw_map->fname assignment makes it now undefined, in case
>> worker_mount_file is an empty string. Of course that's not a useful
>> worker mount file, but I'm a little worried by letting fname be
>> undefined.
>>
>
> Well, we should check for NULL instead relying the empty ("")
> fname will just fail any ->fname call.
I checked, we always init fname to NULL in uri_worker_map_alloc(), so it
is well defined. OK.
Regards,
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: svn commit: r745898 - in /tomcat/connectors/trunk/jk: native/iis/jk_isapi_plugin.c
xdocs/miscellaneous/changelog.xml
Posted by Mladen Turk <mt...@apache.org>.
Rainer Jung wrote:
> On 19.02.2009 16:28, mturk@apache.org wrote:
>> Author: mturk
>> Date: Thu Feb 19 15:28:47 2009
>> New Revision: 745898
>>
>> URL: http://svn.apache.org/viewvc?rev=745898&view=rev
>> Log:
>> Update uriworkermap on watchog interval
>>
>> Modified:
>> tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c
>> tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
>>
>> 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=745898&r1=745897&r2=745898&view=diff
>>
>> ==============================================================================
>>
>> --- tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c (original)
>> +++ tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c Thu Feb 19
>> 15:28:47 2009
>> @@ -2377,6 +2377,11 @@
>> jk_log(logger, JK_LOG_DEBUG,
>> "Watchdog thread running");
>> }
>> + if (worker_mount_file[0]) {
>> + jk_shm_lock();
>> + uri_worker_map_update(uw_map, 0, logger);
>> + jk_shm_unlock();
>> + }
>
> Why the shm lock/unlock? The map itself has a lock that gets used. We
> don't use the shm lock around map_uri_to_worker_ext(), which also goes
> down to map_uri_to_worker_ext().
>
Because IIS6+ can have multiple worker processes.
map lock is thread lock not shared across childs.
> Another thing: do you think it's useful to add this to Apache 2.0 too?
> What's the reason for it (the map is automatically updated when a
> request comes in).
>
Apache has graceful restart, so I doubt this makes sense.
>> - uw_map->fname = worker_mount_file;
>> uw_map->reload = worker_mount_reload;
>> - if (worker_mount_file[0])
>> + if (worker_mount_file[0]) {
>> + uw_map->fname = worker_mount_file;
>> rc = uri_worker_map_load(uw_map, logger);
>> + }
>
> Moving the uw_map->fname assignment makes it now undefined, in case
> worker_mount_file is an empty string. Of course that's not a useful
> worker mount file, but I'm a little worried by letting fname be undefined.
>
Well, we should check for NULL instead relying the empty ("")
fname will just fail any ->fname call.
Regards
--
^(TM)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: svn commit: r745898 - in /tomcat/connectors/trunk/jk: native/iis/jk_isapi_plugin.c
xdocs/miscellaneous/changelog.xml
Posted by Rainer Jung <ra...@kippdata.de>.
On 19.02.2009 16:28, mturk@apache.org wrote:
> Author: mturk
> Date: Thu Feb 19 15:28:47 2009
> New Revision: 745898
>
> URL: http://svn.apache.org/viewvc?rev=745898&view=rev
> Log:
> Update uriworkermap on watchog interval
>
> Modified:
> tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c
> tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
>
> 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=745898&r1=745897&r2=745898&view=diff
> ==============================================================================
> --- tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c (original)
> +++ tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c Thu Feb 19 15:28:47 2009
> @@ -2377,6 +2377,11 @@
> jk_log(logger, JK_LOG_DEBUG,
> "Watchdog thread running");
> }
> + if (worker_mount_file[0]) {
> + jk_shm_lock();
> + uri_worker_map_update(uw_map, 0, logger);
> + jk_shm_unlock();
> + }
Why the shm lock/unlock? The map itself has a lock that gets used. We
don't use the shm lock around map_uri_to_worker_ext(), which also goes
down to map_uri_to_worker_ext().
Another thing: do you think it's useful to add this to Apache 2.0 too?
What's the reason for it (the map is automatically updated when a
request comes in).
> wc_maintain(logger);
> }
> if (JK_IS_DEBUG_LEVEL(logger)) {
> @@ -2499,10 +2504,11 @@
> uw_map->reject_unsafe = 1;
> else
> uw_map->reject_unsafe = 0;
> - uw_map->fname = worker_mount_file;
> uw_map->reload = worker_mount_reload;
> - if (worker_mount_file[0])
> + if (worker_mount_file[0]) {
> + uw_map->fname = worker_mount_file;
> rc = uri_worker_map_load(uw_map, logger);
> + }
Moving the uw_map->fname assignment makes it now undefined, in case
worker_mount_file is an empty string. Of course that's not a useful
worker mount file, but I'm a little worried by letting fname be undefined.
> }
> if (rc) {
> rc = JK_FALSE;
>
Regards,
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org