Skip to content

upstream: consistent H1 and H2 rq_total stats#6352

Merged
mattklein123 merged 2 commits intoenvoyproxy:masterfrom
spenceral:fix-conn-pool-stats
Mar 23, 2019
Merged

upstream: consistent H1 and H2 rq_total stats#6352
mattklein123 merged 2 commits intoenvoyproxy:masterfrom
spenceral:fix-conn-pool-stats

Conversation

@spenceral
Copy link
Copy Markdown
Contributor

Description: Previously, we incremented rq_total and upstream_rq_total for the HTTP/1
conn pool even if the request ended up being circuit broken. The stats
were not incremented for HTTP/2 requests. This change no longer
increments the stats for HTTP/1 circuit broken requests for consistency
between the two.
Risk Level: Low
Testing: Added checks to an existing unit test
Docs Changes: N/A
Release Notes: N/A
Fixes #6350

Previously, we incremented rq_total and upstream_rq_total in the HTTP/1
conn pool even if the request ended up being circuit broken. The stats
were not incremented for HTTP/2 requests. This change no longer
increments the stats for HTTP/1 circuit broken requests for consistency
between the two.

Signed-off-by: Spencer Lewis <slewis@squareup.com>
@mattklein123 mattklein123 self-assigned this Mar 22, 2019
Copy link
Copy Markdown
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 so much for jumping on this. 1 small comment. Also, do you mind adding a release note? I think it's fine to just change this since it makes more sense, but probably worth a note.

/wait

host_->cluster().stats().upstream_rq_total_.inc();
host_->stats().rq_total_.inc();
if (!ready_clients_.empty()) {
host_->cluster().stats().upstream_rq_total_.inc();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you potentially move this into attachRequestToCleint() and remove from below? I think it's better to have the logic in one place and it's more accurate since we still may not send the request upstream if it gets cancelled while pending.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This makes sense to me, thanks for catching that pending request case.

Signed-off-by: Spencer Lewis <slewis@squareup.com>
Copy link
Copy Markdown
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.

Sweet, thanks!

/retest

@repokitteh-read-only
Copy link
Copy Markdown

🙀 failed invoking rebuild of ci/circleci: ipv6_tests: 500 Internal Server Error

🐱

Caused by: a #6352 (review) was submitted by @mattklein123.

see: more, trace.

@mattklein123 mattklein123 merged commit 80ff365 into envoyproxy:master Mar 23, 2019
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.

2 participants