-
Notifications
You must be signed in to change notification settings - Fork 5.1k
http: fix upstream_rq stat increment #4055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http: fix upstream_rq stat increment #4055
Conversation
Signed-off-by: Rama <rama.rao@salesforce.com>
@mattklein123 PTAL. Fixed upstream_rq increment incase of connection failure in http1. For http2 it seems to work correctly, so just added test validation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this 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(); |
There was a problem hiding this comment.
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>
@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(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
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