users@jersey.java.net

Comment regarding http-thread-pool Idle Thread Timeout setting

From: NBW <emailnbw_at_gmail.com>
Date: Mon, 2 Aug 2010 17:32:52 -0400

Hi folks,

I have a question about the behavior I am seeing with the http-thread-pool
Idle Thread Timeout value. I have a Jersey resource endpoint with receives a
call. The resource class looks something like this:

@Path("/myResource")
@RequestScoped
public class MyResource {

  @EJB
   MyEJB myEJB;

  @POST
  @Consumes("application/x-www-form-urlencoded")
  @Produces("text/plain")
  public String doSomethingLongRunning(@FormParam("name") final String name)
throws DoSomethingLongRunningExeception {

    does some long running task

    return "ok";

  }
}

So that's the gist of what if going on. Now what I am seeing is that if the
long running task takes longer then the value of http-thread-pool Idle
Thread Timeout, the thread running this task (an http-thread-pool thread)
will receive an InterruptedException.

If this is the intended behavior then calling this value "Idle Thread
Timeout" is a bit misleading because the thread being interrupted need not
be "idle" for this to happen it just needs to be RUNNING for longer then
this timeout value.

-Noah