Skip to content

Conversation

ramaraochavali
Copy link
Contributor

Signed-off-by: Rama rama.rao@salesforce.com
Description: Increment upstream_rq in case of connection failures also for http1.
Risk Level: Low
Testing: Added Automated tests
Docs Changes: N/A
Release Notes: N/A
Fixes #3950

Signed-off-by: Rama <rama.rao@salesforce.com>
@ramaraochavali
Copy link
Contributor Author

@mattklein123 PTAL. Fixed upstream_rq increment incase of connection failure in http1. For http2 it seems to work correctly, so just added test validation.

@htuch htuch self-assigned this Aug 5, 2018
htuch
htuch previously approved these changes Aug 5, 2018
Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

@@ -145,6 +145,11 @@ void ConnPoolImpl::onConnectionEvent(ActiveClient& client, Network::ConnectionEv
// The only time this happens is if we actually saw a connect failure.
host_->cluster().stats().upstream_cx_connect_fail_.inc();
host_->stats().cx_connect_fail_.inc();

// Increment the total requests also.
host_->cluster().stats().upstream_rq_total_.inc();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to consolidate this logic and only increment these stats in 1 place. Can you take a look at the other place we do this and move the increment to when the connection pool is first asked for a stream?

Signed-off-by: Rama <rama.rao@salesforce.com>
@ramaraochavali
Copy link
Contributor Author

@mattklein123 consolidated the logic. PTAL when you get a chance?

@@ -265,9 +268,7 @@ ConnPoolImpl::StreamWrapper::StreamWrapper(StreamDecoder& response_decoder, Acti
StreamDecoderWrapper(response_decoder), parent_(parent) {

StreamEncoderWrapper::inner_.getStream().addCallbacks(*this);
parent_.parent_.host_->cluster().stats().upstream_rq_total_.inc();
parent_.parent_.host_->cluster().stats().upstream_rq_active_.inc();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arguably rq_active should move also, though, the logic to keep that consistent will be more complicated and I'm not sure it's worth it. Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.It may not be worth the complication.

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@mattklein123 mattklein123 merged commit e96d4a6 into envoyproxy:master Aug 7, 2018
@ramaraochavali ramaraochavali deleted the fix/stats_count branch August 8, 2018 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants