From ddb10ff6523143dd1dbcf31f0477b8deff840057 Mon Sep 17 00:00:00 2001 From: Susan Hinrichs Date: Wed, 12 May 2021 22:51:28 +0000 Subject: [PATCH 1/3] Fix so EOS are delivered to sessions in the pool --- proxy/PoolableSession.h | 2 ++ proxy/http/Http1ServerSession.h | 2 +- proxy/http/HttpSessionManager.cc | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/proxy/PoolableSession.h b/proxy/PoolableSession.h index 76946ef34ce..802ddb3eaa1 100644 --- a/proxy/PoolableSession.h +++ b/proxy/PoolableSession.h @@ -83,6 +83,8 @@ class PoolableSession : public ProxySession void set_netvc(NetVConnection *newvc); + virtual IOBufferReader *get_reader() = 0; + private: // Sessions become if authentication headers // are sent over them diff --git a/proxy/http/Http1ServerSession.h b/proxy/http/Http1ServerSession.h index 0de92de92a2..c74cc80d7fa 100644 --- a/proxy/http/Http1ServerSession.h +++ b/proxy/http/Http1ServerSession.h @@ -76,7 +76,7 @@ class Http1ServerSession : public PoolableSession void start() override; void enable_outbound_connection_tracking(OutboundConnTrack::Group *group); - IOBufferReader *get_reader(); + IOBufferReader *get_reader() override; void attach_hostname(const char *hostname); IpEndpoint const &get_server_ip() const; diff --git a/proxy/http/HttpSessionManager.cc b/proxy/http/HttpSessionManager.cc index 4f7fabbe3de..311164cdc97 100644 --- a/proxy/http/HttpSessionManager.cc +++ b/proxy/http/HttpSessionManager.cc @@ -206,7 +206,9 @@ ServerSessionPool::releaseSession(PoolableSession *ss) // if it closes on us. We will get called back in the // continuation for this bucket, ensuring we have the lock // to remove the connection from our lists - ss->do_io_read(this, 0, nullptr); + // Actually need to have a buffer here, otherwise the vc is + // disabled + ss->do_io_read(this, 0, ss->get_reader()->mbuf); // Transfer control of the write side as well ss->do_io_write(this, 0, nullptr); From 33265583f3d86f7c7cb9e22984cd2a795f05d2b8 Mon Sep 17 00:00:00 2001 From: Susan Hinrichs Date: Thu, 13 May 2021 16:28:17 +0000 Subject: [PATCH 2/3] The read must be non-zero to be active and catch the EOS --- proxy/http/HttpSessionManager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/http/HttpSessionManager.cc b/proxy/http/HttpSessionManager.cc index 311164cdc97..462225969b5 100644 --- a/proxy/http/HttpSessionManager.cc +++ b/proxy/http/HttpSessionManager.cc @@ -208,7 +208,7 @@ ServerSessionPool::releaseSession(PoolableSession *ss) // to remove the connection from our lists // Actually need to have a buffer here, otherwise the vc is // disabled - ss->do_io_read(this, 0, ss->get_reader()->mbuf); + ss->do_io_read(this, INT64_MAX, ss->get_reader()->mbuf); // Transfer control of the write side as well ss->do_io_write(this, 0, nullptr); From dee71295d3f2dae3d89a6abc426e2390559cfb78 Mon Sep 17 00:00:00 2001 From: Susan Hinrichs Date: Thu, 13 May 2021 23:39:59 +0000 Subject: [PATCH 3/3] Fix shutdown for keep alive slave server session --- proxy/http/Http1ClientSession.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/http/Http1ClientSession.cc b/proxy/http/Http1ClientSession.cc index 9670dee2d4a..d070bd9462f 100644 --- a/proxy/http/Http1ClientSession.cc +++ b/proxy/http/Http1ClientSession.cc @@ -468,7 +468,7 @@ Http1ClientSession::attach_server_session(PoolableSession *ssession, bool transa // have it call the client session back. This IO also prevent // the server net conneciton from calling back a dead sm SET_HANDLER(&Http1ClientSession::state_keep_alive); - slave_ka_vio = ssession->do_io_read(this, 0, nullptr); + slave_ka_vio = ssession->do_io_read(this, INT64_MAX, ssession->get_reader()->mbuf); ink_assert(slave_ka_vio != ka_vio); // Transfer control of the write side as well