Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 340722

Summary: Ability to control thread allocation for incoming request
Product: [RT] Jetty Reporter: David Liu <mrveaven>
Component: serverAssignee: Greg Wilkins <gregw>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: jetty-inbox
Version: unspecified   
Target Milestone: 7.2.x   
Hardware: All   
OS: All   
Whiteboard:

Description David Liu CLA 2011-03-23 00:21:21 EDT
Build Identifier: 6.1.21

  Currently, the thread allocation model of Jetty is *per connection per thread*, so Jetty will assign one thread when a connection/request is coming, and this thread is responsible for read and process.
  Is it possible to have an extension point in SelectChannelEndPoint's run() to control the thread allocation.

  One use case is: I have one web service on http://localhost:7777/Web, and my web service will do some calculation for soap message. However, some calculation may become very slow (e.g. db outage) which could occupy all my Jetty thread. I would like to check the http request to find out if it is the request in question, if it is then I put it in a queue and do not dispatch it to thread-pool. In this way, we can avoid many threads working on the in-question soap request.

David

Reproducible: Always
Comment 1 Greg Wilkins CLA 2011-03-31 18:07:46 EDT
If you use the select channel connector and continuations (or servlet 3.0 API in jetty-8), then you can suspend request handling and return the thread to the thread pool.  Once a result is available, you can then resume the request and it will replay and serve the results.   Google for "jetty continuation"
Comment 2 David Liu CLA 2011-04-07 04:19:38 EDT
Thanks Greg. continuations api works for me.

David
Comment 3 Jesse McConnell CLA 2011-09-20 15:52:21 EDT
Resolved -> Closed