Skip to content

Commit

Permalink
THRIFT-2402: byte count of FrameBuffer in AWAITING_CLOSE state is not…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
jfarrell committed Apr 4, 2014
1 parent 607355e commit bdbf428
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,9 @@ public void changeSelectInterests() {
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();
Expand Down

0 comments on commit bdbf428

Please sign in to comment.