You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Matthias Kerkhoff (JIRA)" <co...@jakarta.apache.org> on 2004/12/09 12:46:15 UTC

[jira] Created: (JELLY-174) does not use onlyWait as maximum wait time for thread groups

<threads:waitFor> does not use onlyWait as maximum wait time for thread groups
------------------------------------------------------------------------------

         Key: JELLY-174
         URL: http://nagoya.apache.org/jira/browse/JELLY-174
     Project: jelly
        Type: Bug
    Reporter: Matthias Kerkhoff


Consider 
  <threads:waitFor group="${tg}" onlyWait="60000" status="SUCCESS"/>

How long will this tag wait at most? Well, it depends. It depends on how many threads are in the group. The worst case will be onlyWait * tg.size(). Each thread, however, may not take longer than onlyWait to complete.

>From my experience when a timeout like onlyWait is needed, one usually wants to set an upper limit for the _group_ as a whole. How this timeout is spread among the threads in the group often doesn't matter. 
In the current implementation, the limit is a per-thread timeout even if a group is specified.

I would suggest a small code change, which changes the behaviour of waitFor in a way that when a group is specified the timeout specifies the time that _all_ threads in the group may take to end or to reach the specified status.

The old behaviour can easily be achieved by iterating over each thread in the group and calling <threads:waitFor> for that thread.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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


[jira] Updated: (JELLY-174) does not use onlyWait as maximum wait time for thread groups

Posted by "Matthias Kerkhoff (JIRA)" <co...@jakarta.apache.org>.
     [ http://nagoya.apache.org/jira/browse/JELLY-174?page=history ]

Matthias Kerkhoff updated JELLY-174:
------------------------------------

    Attachment: WaitForTag.java

Small code change which makes onlyWait to act as a strict upper bound for the total time spent waiting on all threads of given thread group.

> <threads:waitFor> does not use onlyWait as maximum wait time for thread groups
> ------------------------------------------------------------------------------
>
>          Key: JELLY-174
>          URL: http://nagoya.apache.org/jira/browse/JELLY-174
>      Project: jelly
>         Type: Bug
>     Reporter: Matthias Kerkhoff
>  Attachments: WaitForTag.java
>
> Consider 
>   <threads:waitFor group="${tg}" onlyWait="60000" status="SUCCESS"/>
> How long will this tag wait at most? Well, it depends. It depends on how many threads are in the group. The worst case will be onlyWait * tg.size(). Each thread, however, may not take longer than onlyWait to complete.
> From my experience when a timeout like onlyWait is needed, one usually wants to set an upper limit for the _group_ as a whole. How this timeout is spread among the threads in the group often doesn't matter. 
> In the current implementation, the limit is a per-thread timeout even if a group is specified.
> I would suggest a small code change, which changes the behaviour of waitFor in a way that when a group is specified the timeout specifies the time that _all_ threads in the group may take to end or to reach the specified status.
> The old behaviour can easily be achieved by iterating over each thread in the group and calling <threads:waitFor> for that thread.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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