thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "zhongting (JIRA)" <j...@apache.org>
Subject [jira] [Created] (THRIFT-4021) THttpTransport may cause consistent memory increase
Date Fri, 06 Jan 2017 10:03:58 GMT
zhongting created THRIFT-4021:
---------------------------------

             Summary: THttpTransport may cause consistent memory increase
                 Key: THRIFT-4021
                 URL: https://issues.apache.org/jira/browse/THRIFT-4021
             Project: Thrift
          Issue Type: Bug
          Components: C++ - Library
    Affects Versions: 0.9.3
         Environment: CentOS release 5.4
            Reporter: zhongting


In THttpTransport.cpp,there are two chances for shifting httpPos_ to the head of http buffer:
1)No CRLF found in function THttpTransport::readLine() 2)avail == 0 in function THttpTransport::readContent().
However,if every message arrives in whole at once,the above two chances won't exist forever
and make the http buffer increase infinitely in function refill(),so cause memory increase
consistently.
I have encountered this issue in one of my project using THttpServer and detected memory increasing
in function refill() with valgrind.
And my solution is adding shift() before returning of function THttpTransport::readContent()
to make sure httpPos_ shifting always happen.
Looking forward for your comments.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message