You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2018/01/12 16:24:28 UTC
[trafficserver] branch master updated: new_MIOBuffer: uninitialized
water_mark fix.
This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new db81103 new_MIOBuffer: uninitialized water_mark fix.
db81103 is described below
commit db81103d05efb94d72f5da953388eff08916db17
Author: Gancho Tenev <ga...@apache.org>
AuthorDate: Thu Jan 11 21:35:18 2018 -0800
new_MIOBuffer: uninitialized water_mark fix.
While calling new_MIOBuffer() the water_mark is not initialized,
water_mark could end up with a very high (random) value to be used
during the network reads. This always results in overly aggressive
uninterrupted reading from the connection, severe buffer size increase
and CPU saturation of one or more ET_NET threads which renders the
traffic server unresponsive. Initializing the water_mark fixes the issue.
The problem can be easily reproduced by a series of very large TLS POST
requests in combination with a stalling origin server and periodic use
of FetchSM which internally allocates a buffer using new_MIOBuffer()
and sets water_mark to INT64_MAX.
While serving the POST requests a buffer previously used by FetchSM
would be reused and its water_mark would end up being equal to IN64_MAX
since the water mark is not initialized when calling new_MIOBuffer().
This always results in aggressive uninterrupted network reads, the
buffer size keep growing progressively and the constant block iteration
in IOBufferReader::read_avail() at some point would saturate the ET_NET
thread CPU.
This patch should fix issue #2144
Additionally fixed erroneous #ifdef TS_USE_PORT directive in
SSLNetVConnection::net_read_io().
---
iocore/eventsystem/P_IOBuffer.h | 1 +
iocore/net/SSLNetVConnection.cc | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/iocore/eventsystem/P_IOBuffer.h b/iocore/eventsystem/P_IOBuffer.h
index dc29937..748811c 100644
--- a/iocore/eventsystem/P_IOBuffer.h
+++ b/iocore/eventsystem/P_IOBuffer.h
@@ -1123,6 +1123,7 @@ MIOBuffer::alloc(int64_t i)
#endif
_writer->alloc(i);
size_index = i;
+ water_mark = 0;
init_readers();
}
diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index f3f2f09..9c2a513 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -625,7 +625,7 @@ SSLNetVConnection::net_read_io(NetHandler *nh, EThread *lthread)
read.triggered = 0;
nh->read_ready_list.remove(this);
Debug("ssl", "read_from_net, read finished - would block");
-#ifdef TS_USE_PORT
+#if TS_USE_PORT
if (ret == SSL_READ_WOULD_BLOCK) {
readReschedule(nh);
} else {
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].