Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.6
-
None
-
Any
-
Patch Available
Description
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)
We started having this problem when we set MAX_READ_BUFFER_BYTES to a somewhat small size, which unmasked the issue.