You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rahul Kumar <ra...@adiquity.com> on 2013/05/13 19:01:01 UTC

Async Context not timing out

Hi All,

I need some help with the async context timeout in servlet 3.0 running on
tomcat 7.0.40.

I have set the asynccontext timeout value, but the timeout behaviour is
highly inconsistent. Sometimes the timeouts work, but most of the times
they don't. I am attaching the source code and the output in plain text
format.

I have tried this on Tomcat 7.0.20, 7.0.37, 7.0.40. Nothing seems to
help. Am i doing something wrong?

Please help. Apologize if I am wasting your time! But I need to fix it.

Thanks for your help!

-Rahul

-- 
*Meet AdIQuity at:*
*Ad:Tech, Singapore *on 13th-14th June 2013

*The information contained in this communication is intended solely for the 
use of the individual or entity to whom it is addressed and others 
authorized to receive it. This communication may contain confidential or 
legally privileged information. If you are not the intended recipient, any 
disclosure, copying, distribution or action taken relying on the contents 
is prohibited and may be unlawful. If you have received this communication 
in error, or if you or your employer does not consent to email messages of 
this kind, please notify to sender immediately by responding to this email 
and then delete it from your system. No liability is accepted for any harm 
that may be caused to your systems or data by this message.*

Re: Async Context not timing out

Posted by Rahul Kumar <ra...@adiquity.com>.
Hi Mark,

Thanks for the reply.

As I could understand from this bug
https://issues.apache.org/bugzilla/show_bug.cgi?id=53061 , and referring to
your comment "Looking at the NIO source code, there is a test that
essentially means that timeouts only get processed after one second of
inactivity so under high, constant load, timeouts will never be processed. I
find it hard to believe it has always been like that so I'll need to go
back and research who changed it (probably me), when it changed (probably
the refactoring) and why it changed (probably an error on my part). I
should be able to get that done pretty quickly. *This has been fixed in
trunk and 7.0.x and will be included in 7.0.28 onwards. *", I assumed that
the frequency of the timeout check was reduced. But now that you're saying
that it is still there, using async timeout won't serve the purpose for me,
because the timeouts for me can be anything from 100 millis to 10000
millis.  I think I should be using a timer thread or a HashWheeledTimer
instead!

Thank You!

-Rahul

PS: The async timeout works just fine with higher timeout and sleep values
for e.g. (a timeout of 1000 millis and a sleep of 4000 millis always
guarantees a timeout.



On Tue, May 14, 2013 at 2:16 AM, Mark Thomas <ma...@apache.org> wrote:

> On 13/05/2013 18:01, Rahul Kumar wrote:
> > Hi All,
> >
> > I need some help with the async context timeout in servlet 3.0 running
> > on tomcat 7.0.40.
> >
> > I have set the asynccontext timeout value, but the timeout behaviour is
> > highly inconsistent. Sometimes the timeouts work, but most of the times
> > they don't. I am attaching the source code and the output in plain text
> > format.
> >
> > I have tried this on Tomcat 7.0.20, 7.0.37, 7.0.40. Nothing seems to
> help. Am i doing something wrong?
>
> Yes and no. You are making assumptions about how frequently timeouts are
> checked. Tomcat only checks them every second for APR/native and BIO.
> NIO always checks every second by default and may check more frequently
> when under low load.
>
> Mark
>
> >
> > Please help. Apologize if I am wasting your time! But I need to fix it.
> >
> > Thanks for your help!
> >
> > -Rahul
> >
> > /Meet AdIQuity at:/
> > *Ad:Tech, Singapore *on 13th-14th June 2013
> >
> > /The information contained in this communication is intended solely for
> > the use of the individual or entity to whom it is addressed and others
> > authorized to receive it. This communication may contain confidential or
> > legally privileged information. If you are not the intended recipient,
> > any disclosure, copying, distribution or action taken relying on the
> > contents is prohibited and may be unlawful. If you have received this
> > communication in error, or if you or your employer does not consent to
> > email messages of this kind, please notify to sender immediately by
> > responding to this email and then delete it from your system. No
> > liability is accepted for any harm that may be caused to your systems or
> > data by this message./
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

-- 
*Meet AdIQuity at:*
*Ad:Tech, Singapore *on 13th-14th June 2013

*The information contained in this communication is intended solely for the 
use of the individual or entity to whom it is addressed and others 
authorized to receive it. This communication may contain confidential or 
legally privileged information. If you are not the intended recipient, any 
disclosure, copying, distribution or action taken relying on the contents 
is prohibited and may be unlawful. If you have received this communication 
in error, or if you or your employer does not consent to email messages of 
this kind, please notify to sender immediately by responding to this email 
and then delete it from your system. No liability is accepted for any harm 
that may be caused to your systems or data by this message.*

Re: Async Context not timing out

Posted by Mark Thomas <ma...@apache.org>.
On 13/05/2013 18:01, Rahul Kumar wrote:
> Hi All,
> 
> I need some help with the async context timeout in servlet 3.0 running
> on tomcat 7.0.40. 
> 
> I have set the asynccontext timeout value, but the timeout behaviour is
> highly inconsistent. Sometimes the timeouts work, but most of the times
> they don't. I am attaching the source code and the output in plain text
> format.
> 
> I have tried this on Tomcat 7.0.20, 7.0.37, 7.0.40. Nothing seems to help. Am i doing something wrong?

Yes and no. You are making assumptions about how frequently timeouts are
checked. Tomcat only checks them every second for APR/native and BIO.
NIO always checks every second by default and may check more frequently
when under low load.

Mark

> 
> Please help. Apologize if I am wasting your time! But I need to fix it. 
> 
> Thanks for your help!
> 
> -Rahul
> 
> /Meet AdIQuity at:/
> *Ad:Tech, Singapore *on 13th-14th June 2013
> 
> /The information contained in this communication is intended solely for
> the use of the individual or entity to whom it is addressed and others
> authorized to receive it. This communication may contain confidential or
> legally privileged information. If you are not the intended recipient,
> any disclosure, copying, distribution or action taken relying on the
> contents is prohibited and may be unlawful. If you have received this
> communication in error, or if you or your employer does not consent to
> email messages of this kind, please notify to sender immediately by
> responding to this email and then delete it from your system. No
> liability is accepted for any harm that may be caused to your systems or
> data by this message./
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


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