Skip to content

shadow: fix crash when shadow cluster does not exist#4582

Merged
ggreenway merged 3 commits intomasterfrom
shadow_no_cluster
Oct 2, 2018
Merged

shadow: fix crash when shadow cluster does not exist#4582
ggreenway merged 3 commits intomasterfrom
shadow_no_cluster

Conversation

@mattklein123
Copy link
Member

This can happen when shadowing is used with RDS and CDS.

Fixes #4504

Risk Level: Low
Testing: New UT
Docs Changes: N/A
Release Notes: N/A

This can happen when shadowing is used with RDS and CDS.

Fixes #4504

Signed-off-by: Matt Klein <mklein@lyft.com>
junr03
junr03 previously approved these changes Oct 2, 2018
Copy link
Member

@junr03 junr03 left a comment

Choose a reason for hiding this comment

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

lgtm, just a small comment.

// to a CDS removal. Check that it still exists before shadowing.
// TODO(mattklein123): Optimally we would have a stat but for now just fix the crashing issue.
if (!cm_.get(cluster)) {
return;
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should at least leave a warn log behind so people are not at a loss for why they're not seeing shadow traffic.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think a warn log is not a great idea since this is in the data path and could spam quite a bit. Though I had considered at least adding a debug log so I will do that.

Copy link
Member

Choose a reason for hiding this comment

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

As you mention in the comment, I think a stat is most appropriate in this path. But I'm fine with merging this crash-fix as-is. @junr03 you ok with that?

ggreenway
ggreenway previously approved these changes Oct 2, 2018
// to a CDS removal. Check that it still exists before shadowing.
// TODO(mattklein123): Optimally we would have a stat but for now just fix the crashing issue.
if (!cm_.get(cluster)) {
return;
Copy link
Member

Choose a reason for hiding this comment

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

As you mention in the comment, I think a stat is most appropriate in this path. But I'm fine with merging this crash-fix as-is. @junr03 you ok with that?

@mattklein123 mattklein123 dismissed stale reviews from ggreenway and junr03 via e7fe19e October 2, 2018 17:09
@mattklein123
Copy link
Member Author

@junr03 @ggreenway I added a debug log. PTAL.

@ggreenway ggreenway merged commit e6b47ec into master Oct 2, 2018
@mattklein123 mattklein123 deleted the shadow_no_cluster branch October 4, 2018 21:54
aa-stripe pushed a commit to aa-stripe/envoy that referenced this pull request Oct 11, 2018
Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Aaltan Ahmad <aa@stripe.com>
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