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

Bryan Duxbury updated THRIFT-5:
-------------------------------

    Attachment: thrift-5-v2.patch

Here's a much cleaner version of the server, including the implementation of 
THsHaServer. I fixed at least one race condition, simplified the code in some 
places, and added a ton of comments and Javadoc.

In running the TestNonblockingServer and TestClient, I noticed that if you ran 
the TestClient twice too close together, you'd get exceptions. This was because 
the last testAsync call blocked for 3 seconds, but the TestClient's socket 
timeout was only 1 second. I added a new -timeout command line switch that 
supports setting it to 0 for testing nonblocking servers. Similarly, there is a 
-hsha switch on TestNonblockingServer that causes it to use the THsHaServer 
instead of the standard TNonblocking server.

I would love some review comments.

> Need a thread pool server that is fair in terms of invocations, not sockets
> ---------------------------------------------------------------------------
>
>                 Key: THRIFT-5
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>            Reporter: Bryan Duxbury
>         Attachments: thrift-5-v2.patch, thrift-5.patch
>
>
> The current TThreadPoolServer in the Java libraries is suboptimal. If you 
> actually limit the upper bound of threads, and you have long-lived clients, 
> and you have more clients than you have max allowed threads, then any clients 
> in excess of the max number of threads will never be given a time slice to 
> execute. 
> Conceptually, it seems like the correct behavior here is for the individual 
> method invocations to be the items that end up on the thread pool's execution 
> queue, not the individual client sockets (as it is now). This would support 
> this and other use cases better. 
> Perhaps we should do a Half-Sync/Half-Async server to fulfill this goal?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to