users@glassfish.java.net

Re: [Jersey] Comment regarding http-thread-pool Idle Thread Timeout setting

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Tue, 3 Aug 2010 11:25:23 +0200

Hi Noah,

Also the CC users_at_glassfish.dev.java.net as you may get more responses
on that list.

Paul.

On Aug 2, 2010, at 11:32 PM, NBW wrote:

> 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
>
>