You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by jf...@apache.org on 2014/04/04 19:10:46 UTC
git commit: THRIFT-2402: byte count of FrameBuffer in AWAITING_CLOSE
state is not subtracted from readBufferBytesAllocated Client: java Patch:
jfarrell
Repository: thrift
Updated Branches:
refs/heads/master 607355e1d -> bdbf42836
THRIFT-2402: byte count of FrameBuffer in AWAITING_CLOSE state is not subtracted from readBufferBytesAllocated
Client: java
Patch: jfarrell
Addresses issue where changeSelectInterests would cause close() to occur in the AWAITING_CLOSE state and readBufferBytesAllocated was never called
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/bdbf4283
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/bdbf4283
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/bdbf4283
Branch: refs/heads/master
Commit: bdbf428365144dc8586276d42c071b44c389e4ff
Parents: 607355e
Author: jfarrell <jf...@apache.org>
Authored: Fri Apr 4 13:09:32 2014 -0400
Committer: jfarrell <jf...@apache.org>
Committed: Fri Apr 4 13:09:32 2014 -0400
----------------------------------------------------------------------
.../src/org/apache/thrift/server/AbstractNonblockingServer.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/bdbf4283/lib/java/src/org/apache/thrift/server/AbstractNonblockingServer.java
----------------------------------------------------------------------
diff --git a/lib/java/src/org/apache/thrift/server/AbstractNonblockingServer.java b/lib/java/src/org/apache/thrift/server/AbstractNonblockingServer.java
index 80da6ca..fd49d48 100644
--- a/lib/java/src/org/apache/thrift/server/AbstractNonblockingServer.java
+++ b/lib/java/src/org/apache/thrift/server/AbstractNonblockingServer.java
@@ -455,7 +455,9 @@ public abstract class AbstractNonblockingServer extends TServer {
public void close() {
// if we're being closed due to an error, we might have allocated a
// buffer that we need to subtract for our memory accounting.
- if (state_ == FrameBufferState.READING_FRAME || state_ == FrameBufferState.READ_FRAME_COMPLETE) {
+ if (state_ == FrameBufferState.READING_FRAME ||
+ state_ == FrameBufferState.READ_FRAME_COMPLETE ||
+ state_ == FrameBufferState.AWAITING_CLOSE) {
readBufferBytesAllocated.addAndGet(-buffer_.array().length);
}
trans_.close();