diff --git a/docs/root/version_history/current.rst b/docs/root/version_history/current.rst index 8a6bd863c3ef8..1baf70bdf6956 100644 --- a/docs/root/version_history/current.rst +++ b/docs/root/version_history/current.rst @@ -28,6 +28,7 @@ Bug Fixes * ext_authz: fix the ext_authz http filter to correctly set response flags to ``UAEX`` when a connection is denied. * ext_authz: fix the ext_authz network filter to correctly set response flag and code details to ``UAEX`` when a connection is denied. * listener: fixed issue where more than one listener could listen on the same port if using reuse port, thus randomly accepting connections on different listeners. This configuration is now rejected. +* thrift_proxy: do not close downstream connections when an upstream connection overflow happens. * thrift_proxy: fix the thrift_proxy connection manager to correctly report success/error response metrics when performing :ref:`payload passthrough `. Removed Config or Runtime diff --git a/source/extensions/filters/network/thrift_proxy/router/upstream_request.cc b/source/extensions/filters/network/thrift_proxy/router/upstream_request.cc index b1cededafe95a..6947a9856d0e8 100644 --- a/source/extensions/filters/network/thrift_proxy/router/upstream_request.cc +++ b/source/extensions/filters/network/thrift_proxy/router/upstream_request.cc @@ -270,7 +270,7 @@ void UpstreamRequest::onResetStream(ConnectionPool::PoolFailureReason reason) { stats_.incResponseLocalException(parent_.cluster()); parent_.sendLocalReply(AppException(AppExceptionType::InternalError, "thrift upstream request: too many connections"), - true); + false /* Don't close the downstream connection. */); break; case ConnectionPool::PoolFailureReason::LocalConnectionFailure: upstream_host_->outlierDetector().putResult( diff --git a/test/extensions/filters/network/thrift_proxy/router_test.cc b/test/extensions/filters/network/thrift_proxy/router_test.cc index c001013f01886..199a261210c7d 100644 --- a/test/extensions/filters/network/thrift_proxy/router_test.cc +++ b/test/extensions/filters/network/thrift_proxy/router_test.cc @@ -759,7 +759,7 @@ TEST_F(ThriftRouterTest, PoolOverflowFailure) { auto& app_ex = dynamic_cast(response); EXPECT_EQ(AppExceptionType::InternalError, app_ex.type_); EXPECT_THAT(app_ex.what(), ContainsRegex(".*too many connections.*")); - EXPECT_TRUE(end_stream); + EXPECT_FALSE(end_stream); })); context_.cluster_manager_.thread_local_cluster_.tcp_conn_pool_.poolFailure( ConnectionPool::PoolFailureReason::Overflow, true);