You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jake Farrell (JIRA)" <ji...@apache.org> on 2014/04/04 19:10:19 UTC

[jira] [Closed] (THRIFT-2402) byte count of FrameBuffer in AWAITING_CLOSE state is not subtracted from readBufferBytesAllocated

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

Jake Farrell closed THRIFT-2402.
--------------------------------

    Resolution: Fixed
      Assignee: Jake Farrell

Nice catch, the changeSelectInterests would cause close() to occur in the AWAITING_CLOSE state and readBufferBytesAllocated was never called for this case. Thanks, fix committed for it

> byte count of FrameBuffer in AWAITING_CLOSE state is not subtracted from readBufferBytesAllocated
> -------------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-2402
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2402
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Library
>    Affects Versions: 0.9.1
>            Reporter: anm
>            Assignee: Jake Farrell
>             Fix For: 0.9.2
>
>
> FrameBuffer.close() doesn't subtract the count for that in AWAITING_CLOSE state.
>     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) {
>         readBufferBytesAllocated.addAndGet(-buffer_.array().length);
>       }
>       trans_.close();
>       if (eventHandler_ != null) {
>         eventHandler_.deleteContext(context_, inProt_, outProt_);
>       }
>     }



--
This message was sent by Atlassian JIRA
(v6.2#6252)