Skip to content

Fix for MGET crash when upstream Redis Command Stats are enabled - #9954

Merged
mattklein123 merged 9 commits into
envoyproxy:masterfrom
HenryYYang:fix-mget-stats-crash
Feb 20, 2020
Merged

mattklein123 merged 9 commits into
envoyproxy:masterfrom
HenryYYang:fix-mget-stats-crash

Conversation

@FAYiEKcbD0XFqF2QK2E4viAHg8rMm2VbjYKdjTg

@FAYiEKcbD0XFqF2QK2E4viAHg8rMm2VbjYKdjTg FAYiEKcbD0XFqF2QK2E4viAHg8rMm2VbjYKdjTg commented Feb 6, 2020 •

Copy link
Copy Markdown
Contributor

The root cause was not handling all types in a switch statement in RedisCommandStats where I get the command string (ie get, set, etc.). Unfortunately the code path exercised by an mget request from downstream was not exercised so this was not caught by unit or integration tests.

I've explicitly handled all the types; specifically the RespType::CompositeArray which is used in mget. I've also added an integration test that verifies the behavior (and crashes as expected without the fix). The integration test is needed because the mget is downstream-specific; on the upstream side it is converted to gets and the client_impl_test.cc where we tested the RedisCommandStats stats measurement is upstream-specific.

Risk Level: Low
Testing: Local unit/integration on Mac
Docs Changes: N/A
Release Notes: N/A

…nstream MGET test case to exercise this code path

Signed-off-by: Nicolas Flacco <[email protected]>
@junr03

junr03 commented Feb 7, 2020

Copy link
Copy Markdown
Member

Do you mind taking a look at CI and filling out the PR description per the https://github.com/envoyproxy/envoy/blob/master/PULL_REQUESTS.md

@stale

stale Bot commented Feb 18, 2020

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale Bot added stale stalebot believes this issue/PR has not been touched recently and removed stale stalebot believes this issue/PR has not been touched recently labels Feb 18, 2020
@HenryYYang

Copy link
Copy Markdown
Contributor

LGTM. +1

mattklein123
mattklein123 previously approved these changes Feb 20, 2020

@mattklein123 mattklein123 left a comment

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.

Thanks!

@mattklein123

Copy link
Copy Markdown
Member

Oops looks like you need a master merge.

/wait

@mattklein123 mattklein123 left a comment

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.

Thanks!

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.

4 participants