[ 
https://issues.apache.org/jira/browse/THRIFT-1869?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Brock Noland updated THRIFT-1869:
---------------------------------

    Attachment: THRIFT-1869-0.patch

If the user provides an ExecutorService to the TThreadPoolServer they can use a 
custom rejection handler to override the current behavior, dying when all 
threads are consumed.

However, users that use the default ExecutorService get an odd behavior where 
when the thread pool is consumed the entire server dies killing all clients.

An alternative to this default behavior and one that is more in line with my 
expectations based on using a variety of http and RPC servers is that no new 
clients are accepted until space is available in the thread pool. The attached 
patch changes the default behavior to be inline with these other servers.

Should someone desire the behavior that when max threads is hit, they could 
provide an executor service with a rejection handler which throws a runtime 
exception.
                
> TThreadPoolServer (java) dies when max threads hit
> --------------------------------------------------
>
>                 Key: THRIFT-1869
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1869
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Library
>    Affects Versions: 0.9
>            Reporter: Brock Noland
>         Attachments: THRIFT-1869-0.patch
>
>
> When TThreadPoolServer hit's max threads, it throws a 
> RejectedExceptionException and dies. This is not expected by users of this 
> class.
> {noformat}
> java.util.concurrent.RejectedExecutionException 
> at 
> java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(Unknown 
> Source) 
> at java.util.concurrent.ThreadPoolExecutor.reject(Unknown Source) 
> at java.util.concurrent.ThreadPoolExecutor.execute(Unknown Source) 
> at 
> org.apache.thrift.server.TThreadPoolServer.serve(TThreadPoolServer.java:108) 
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to