You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Qu Pingzhe (Jira)" <ji...@apache.org> on 2021/09/02 04:03:00 UTC
[jira] [Created] (THRIFT-5460) TConnection not resetBuffer in
outputTransport when socket write failed
Qu Pingzhe created THRIFT-5460:
----------------------------------
Summary: TConnection not resetBuffer in outputTransport when socket write failed
Key: THRIFT-5460
URL: https://issues.apache.org/jira/browse/THRIFT-5460
Project: Thrift
Issue Type: Bug
Components: C++ - Library
Affects Versions: 0.13.0
Reporter: Qu Pingzhe
Attachments: oom-activity.png
I am not sure if it is a bug. And may affect versions long ago.
* My Server is cpp.TNonblockingServer
* Return 100M data in one rpc
# client send rpc to server
# server recevie by thread0, then write 100M data to socket
# client read timeout, then retry and use another socket
# server recevie by thread1, then write new 100M data to new socket
# ...
# every thread has 100M data, then server is killed by OOM
{code:java}
void TNonblockingServer::TConnection::checkIdleBufferMemLimit(size_t readLimit, size_t writeLimit) {
if (readLimit > 0 && readBufferSize_ > readLimit) {
free(readBuffer_);
readBuffer_ = nullptr;
readBufferSize_ = 0;
} if (writeLimit > 0 && largestWriteBufferSize_ > writeLimit) { // this line
// just start over
outputTransport_->resetBuffer(static_cast<uint32_t>(server_->getWriteBufferDefaultSize()));
largestWriteBufferSize_ = 0;
}
}{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)