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
xds resolver: fix edge cases in interactions between LDS and RDS #31668
Conversation
::testing::Values(XdsTestType().set_enable_rds_testing()), | ||
&XdsTestType::Name); | ||
|
||
TEST_P(LdsRdsInteractionTest, SwitchFromRdsToInlineRouteConfig) { |
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.
which of these tests were failing before this?
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.
Without the fix, both SwitchFromRdsToInlineRouteConfig
and HcmConfigUpdatedWithoutRdsChange
fail.
Automated fix for refs/heads/xds_lds_update_fix
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.
The sleep bothers me but otherwise looks ok
while (true) { | ||
ASSERT_LT(absl::Now(), deadline) << "timed out waiting for LDS ACK"; | ||
response_state = balancer_->ads_service()->lds_response_state(); | ||
if (response_state.has_value()) break; | ||
absl::SleepFor(absl::Seconds(1) * grpc_test_slowdown_factor()); |
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.
uh oh! Why do we need a sleep?
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.
The sleep just avoids wasting CPU time. Without it, this is just a busy loop, constantly checking the same thing over and over again. With the sleep, we pause to actually give the system time to change state before we check again.
Note that the sleep does not affect the overall 30-second deadline for getting the ACK.
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.
something like using a notification might be better
ASSERT_LT(absl::Now(), deadline) << "timed out waiting for LDS ACK"; | ||
response_state = balancer_->ads_service()->lds_response_state(); | ||
if (response_state.has_value()) break; | ||
absl::SleepFor(absl::Seconds(1) * grpc_test_slowdown_factor()); |
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.
here too, why do we need the sleep?
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.
If we need it anyway, can you add a comment as to why?
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.
Same answer as above. It doesn't change the behavior, just avoids wasting CPU time.
ASSERT_LT(absl::Now(), deadline) << "timed out waiting for RDS ACK"; | ||
response_state = balancer_->ads_service()->rds_response_state(); | ||
if (response_state.has_value()) break; | ||
absl::SleepFor(absl::Seconds(1) * grpc_test_slowdown_factor()); |
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.
here too, why do we need the sleep?
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.
Same answer as above. It doesn't change the behavior, just avoids wasting CPU time.
…c#31668) * xds resolver: fix edge cases in interactions between LDS and RDS * improve SwitchFromInlineRouteConfigToRds test * clang-tidy * Automated change: Fix sanity tests Co-authored-by: markdroth <markdroth@users.noreply.github.com>
) (#31672) * xds resolver: fix edge cases in interactions between LDS and RDS * improve SwitchFromInlineRouteConfigToRds test * clang-tidy * Automated change: Fix sanity tests Co-authored-by: markdroth <markdroth@users.noreply.github.com> Co-authored-by: markdroth <markdroth@users.noreply.github.com>
* Bump v1.51.x to 1.51.0-pre1 (#31622) * bump version to 1.51.0-pre1 * regenerate projects * Branch 1.51.x: Cherrypick "Adding token url validation cases for psc endpoints #31616" and "Added url validation for aws metadata endpoints in aws external account #31626" (#31646) * Adding token url validation cases for psc endpoints (#31616) * Adding validation case for psc endpoint * formatting fix * Added url validation for aws metadata endpoints in aws external account (#31626) * Added url validation for aws metadata endpoints in aws external account * addressing review comments * fix error message back * Fix broken test * xds resolver: fix edge cases in interactions between LDS and RDS (#31668) (#31672) * xds resolver: fix edge cases in interactions between LDS and RDS * improve SwitchFromInlineRouteConfigToRds test * clang-tidy * Automated change: Fix sanity tests Co-authored-by: markdroth <markdroth@users.noreply.github.com> Co-authored-by: markdroth <markdroth@users.noreply.github.com> * xDS: fix crash on wrong listener type (both client and server side) (#31684) (#31691) * xds resolver: fix crash on wrong listener type * fix same bug on server side * fix clang-tidy and add requested TODO * Bump v1.51.x to v1.51.0 (#31705) * bump version to 1.51.0 * regenerate projects * Revert "Build with System OpenSSL on Mac OS arm64 (#31096)" (#31739) This reverts commit b3d9833. * Bump v1.51.x to 1.51.1 (#31740) * Bump to 1.51.1 * Regenerate projects Co-authored-by: Richard Belleville <rbellevi@google.com> Co-authored-by: aeitzman <12433791+aeitzman@users.noreply.github.com> Co-authored-by: Mark D. Roth <roth@google.com> Co-authored-by: markdroth <markdroth@users.noreply.github.com>
* Bump v1.51.x to 1.51.0-pre1 (#31622) * bump version to 1.51.0-pre1 * regenerate projects * Branch 1.51.x: Cherrypick "Adding token url validation cases for psc endpoints #31616" and "Added url validation for aws metadata endpoints in aws external account #31626" (#31646) * Adding token url validation cases for psc endpoints (#31616) * Adding validation case for psc endpoint * formatting fix * Added url validation for aws metadata endpoints in aws external account (#31626) * Added url validation for aws metadata endpoints in aws external account * addressing review comments * fix error message back * Fix broken test * xds resolver: fix edge cases in interactions between LDS and RDS (#31668) (#31672) * xds resolver: fix edge cases in interactions between LDS and RDS * improve SwitchFromInlineRouteConfigToRds test * clang-tidy * Automated change: Fix sanity tests Co-authored-by: markdroth <markdroth@users.noreply.github.com> Co-authored-by: markdroth <markdroth@users.noreply.github.com> * xDS: fix crash on wrong listener type (both client and server side) (#31684) (#31691) * xds resolver: fix crash on wrong listener type * fix same bug on server side * fix clang-tidy and add requested TODO * Bump v1.51.x to v1.51.0 (#31705) * bump version to 1.51.0 * regenerate projects * Revert "Build with System OpenSSL on Mac OS arm64 (#31096)" (#31739) This reverts commit b3d9833. * Bump v1.51.x to 1.51.1 (#31740) * Bump to 1.51.1 * Regenerate projects Co-authored-by: Richard Belleville <rbellevi@google.com> Co-authored-by: aeitzman <12433791+aeitzman@users.noreply.github.com> Co-authored-by: Mark D. Roth <roth@google.com> Co-authored-by: markdroth <markdroth@users.noreply.github.com>
This fixes a couple of bugs accidentally introduced in #31457. It adds tests for those bugs and for the edge cases discussed in #25528.
Once this gets merged, it will need to be back-ported to the 1.51 branch before the release. CC @gnossen