You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Peter Rossbach <pr...@objektpark.de> on 2007/04/15 11:50:24 UTC

Comet API question

Hi Filip and Remy

Often, if my HTTP request needs to get a database connection and the  
connection pool is empty,
the request will block for some period of time. The problem is that  
the blocking request will consume a thread while it it blocking.

How can I free up the request thread when the DB pool can be block?

Can I set a event retry timeout and get back the request thread  
without an error?

regards
peter




Re: Comet API question

Posted by Remy Maucherat <re...@apache.org>.
Peter Rossbach wrote:
> Yes,  I want implement access filter. As filter detect overload, it set 
> a event retry timeout and  give back the event.
> Later the event comes back and mark as event type RETRY.

I think you have two solutions:
- do stuff to get notifications that some pool connection is available, 
and write the response using a thread of yours
- set timeout to a "short" value (you can do it with the NIO connector), 
and do processing when getting the timeout event; IMO this is too 
complex, and will have more latency

Rémy

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


Re: Comet API question

Posted by Peter Rossbach <pr...@objektpark.de>.
HI Remy

Am 15.04.2007 um 13:53 schrieb Remy Maucherat:

> Peter Rossbach wrote:
>> Hi Filip and Remy
>> Often, if my HTTP request needs to get a database connection and  
>> the connection pool is empty,
>> the request will block for some period of time. The problem is  
>> that the blocking request will consume a thread while it it blocking.
>> How can I free up the request thread when the DB pool can be block?
>
> Hmm, there's a fundamental problem IMO: you need a thread to block  
> on the DB pool anyway.
>
Yes,  I want implement access filter. As filter detect overload, it  
set a event retry timeout and  give back the event.
Later the event comes back and mark as event type RETRY.

>> Can I set a event retry timeout and get back the request thread  
>> without an error?
>
> At the moment, there are only events for IO (including timeout,  
> which is an "error", but not fatal - you can ignore that event and  
> the connection will go back to the poller).
>
> Rémy
>

Peter



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


Re: Comet API question

Posted by Remy Maucherat <re...@apache.org>.
Peter Rossbach wrote:
> Hi Filip and Remy
> 
> Often, if my HTTP request needs to get a database connection and the 
> connection pool is empty,
> the request will block for some period of time. The problem is that the 
> blocking request will consume a thread while it it blocking.
> 
> How can I free up the request thread when the DB pool can be block?

Hmm, there's a fundamental problem IMO: you need a thread to block on 
the DB pool anyway.

> Can I set a event retry timeout and get back the request thread without 
> an error?

At the moment, there are only events for IO (including timeout, which is 
an "error", but not fatal - you can ignore that event and the connection 
will go back to the poller).

Rémy


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