[
https://issues.apache.org/jira/browse/THRIFT-1190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13042318#comment-13042318
]
Hudson commented on THRIFT-1190:
--------------------------------
Integrated in Thrift #151 (See
[https://builds.apache.org/hudson/job/Thrift/151/])
THRIFT-1190. java: readBufferBytesAllocated in TNonblockingServer.java
should be AtomicLong to fix FD leakage and general server malfunction
There was a race condition in the use of the memory limiting feature that would
lead to memory loss.
Patch: Tom May
bryanduxbury : http://svn.apache.org/viewvc/?view=rev&rev=1130231
Files :
* /thrift/trunk/lib/java/src/org/apache/thrift/server/TNonblockingServer.java
> 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