Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/root/intro/version_history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Version history
* tracing: added :ref:`verbose <envoy_api_field_config.filter.network.http_connection_manager.v2.HttpConnectionManager.tracing>` to support logging annotations on spans.
* upstream: added support for host weighting and :ref:`locality weighting <arch_overview_load_balancing_locality_weighted_lb>` in the :ref:`ring hash load balancer <arch_overview_load_balancing_types_ring_hash>`, and added a :ref:`maximum_ring_size<envoy_api_field_Cluster.RingHashLbConfig.maximum_ring_size>` config parameter to strictly bound the ring size.
* upstream: added configuration option to select any host when the fallback policy fails.
* upstream: stopped incrementing upstream_rq_total for HTTP/1 conn pool when request is circuit broken.

1.9.0 (Dec 20, 2018)
====================
Expand Down
4 changes: 2 additions & 2 deletions source/common/http/http1/conn_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ bool ConnPoolImpl::hasActiveConnections() const {
void ConnPoolImpl::attachRequestToClient(ActiveClient& client, StreamDecoder& response_decoder,
ConnectionPool::Callbacks& callbacks) {
ASSERT(!client.stream_wrapper_);
host_->cluster().stats().upstream_rq_total_.inc();
host_->stats().rq_total_.inc();
client.stream_wrapper_ = std::make_unique<StreamWrapper>(response_decoder, client);
callbacks.onPoolReady(*client.stream_wrapper_, client.real_host_description_);
}
Expand All @@ -90,8 +92,6 @@ void ConnPoolImpl::createNewConnection() {

ConnectionPool::Cancellable* ConnPoolImpl::newStream(StreamDecoder& response_decoder,
ConnectionPool::Callbacks& callbacks) {
host_->cluster().stats().upstream_rq_total_.inc();
host_->stats().rq_total_.inc();
if (!ready_clients_.empty()) {
ready_clients_.front()->moveBetweenLists(ready_clients_, busy_clients_);
ENVOY_CONN_LOG(debug, "using existing connection", *busy_clients_.front()->codec_client_);
Expand Down
9 changes: 7 additions & 2 deletions test/common/http/http1/conn_pool_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ struct ActiveTestRequest {
parent.conn_pool_.test_clients_[client_index_].connection_->raiseEvent(
Network::ConnectionEvent::Connected);
}
EXPECT_EQ(current_rq_total + 1, parent_.cluster_->stats_.upstream_rq_total_.value());
if (type != Type::Pending) {
EXPECT_EQ(current_rq_total + 1, parent_.cluster_->stats_.upstream_rq_total_.value());
}
}

void completeResponse(bool with_body) {
Expand Down Expand Up @@ -368,7 +370,7 @@ TEST_F(Http1ConnPoolImplTest, ConnectTimeout) {
EXPECT_CALL(conn_pool_, onClientDestroy()).Times(2);
dispatcher_.clearDeferredDeleteList();

EXPECT_EQ(2U, cluster_->stats_.upstream_rq_total_.value());
EXPECT_EQ(0U, cluster_->stats_.upstream_rq_total_.value());
EXPECT_EQ(2U, cluster_->stats_.upstream_cx_connect_fail_.value());
EXPECT_EQ(2U, cluster_->stats_.upstream_cx_connect_timeout_.value());
}
Expand Down Expand Up @@ -630,6 +632,7 @@ TEST_F(Http1ConnPoolImplTest, ConcurrentConnections) {
r1.completeResponse(false);
conn_pool_.expectAndRunUpstreamReady();
r3.startRequest();
EXPECT_EQ(3U, cluster_->stats_.upstream_rq_total_.value());

r2.completeResponse(false);
r3.completeResponse(false);
Expand All @@ -651,6 +654,7 @@ TEST_F(Http1ConnPoolImplTest, DrainCallback) {
ActiveTestRequest r1(*this, 0, ActiveTestRequest::Type::CreateConnection);
ActiveTestRequest r2(*this, 0, ActiveTestRequest::Type::Pending);
r2.handle_->cancel();
EXPECT_EQ(1U, cluster_->stats_.upstream_rq_total_.value());

EXPECT_CALL(drained, ready());
r1.startRequest();
Expand Down Expand Up @@ -756,6 +760,7 @@ TEST_F(Http1ConnPoolImplTest, PendingRequestIsConsideredActive) {

EXPECT_CALL(conn_pool_, onClientDestroy());
r1.handle_->cancel();
EXPECT_EQ(0U, cluster_->stats_.upstream_rq_total_.value());
conn_pool_.drainConnections();
conn_pool_.test_clients_[0].connection_->raiseEvent(Network::ConnectionEvent::RemoteClose);
dispatcher_.clearDeferredDeleteList();
Expand Down