Alejandro Abdelnur created THRIFT-2235:
------------------------------------------

             Summary: TThreadPoolServer should have a NOP reject policy
                 Key: THRIFT-2235
                 URL: https://issues.apache.org/jira/browse/THRIFT-2235
             Project: Thrift
          Issue Type: Bug
          Components: Java - Library
    Affects Versions: 0.9.1
            Reporter: Alejandro Abdelnur


We are running into the issue described in THRIFT-692.

It is possible to reproduce this easily by having concurrent requests exceeding 
the number of maximum threads.

In this scenario, the threadpoolexecutor fails with an exception and the thrift 
server endpoint becomes unresponsive.

The ThreadPoolExecutor should set a discard rejection policy to avoid this 
issue.  

{code}
    executor.setRejectedExecutionHandler(new RejectedExecutionHandler() {
      @Override
      public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
      //LOG ERROR indicating that client request is being discarded.
      }
    });
{code}

Also, as suggested in THRIFT-692, using a bounded LinkedBlockingQueue instead 
the a SynchronousQueue would help to cope with spikes of requests beyond the 
max number of threads without failing users.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to