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

Bryan Duxbury closed THRIFT-1190.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 0.7
         Assignee: Tom May

Nice catch! I just committed this patch.

> readBufferBytesAllocated in TNonblockingServer.java should be AtomicLong to 
> fix FD leakage and general server malfunction
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-1190
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1190
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Library
>    Affects Versions: 0.6
>         Environment: Any
>            Reporter: Tom May
>            Assignee: Tom May
>             Fix For: 0.7
>
>         Attachments: thrift.patch
>
>
> We're having a problem using THsHaServer where the server suddenly stops 
> closing connections and runs out of file descriptors.
> It looks like the problem is in TNonblockingServer.java.  The variable "long 
> readBufferBytesAllocated" is shared between threads but isn't synchronized.  
> Intermittently, its value can get out of whack due to races and cause this if 
> statement to always execute:
>           // if this frame will push us over the memory limit, then return.
>           // with luck, more memory will free up the next time around.
>           if (readBufferBytesAllocated.get() + frameSize > 
> MAX_READ_BUFFER_BYTES) {
>             return true;
>           }
> We started having this problem when we set MAX_READ_BUFFER_BYTES to a 
> somewhat small size, which unmasked the issue.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to