Skip to content
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: introduce initial_fetch_timeout option to limit initialization time #6048

Merged
merged 9 commits into from
Mar 15, 2019

Conversation

MarcinFalkowski
Copy link
Contributor

@MarcinFalkowski MarcinFalkowski commented Feb 25, 2019

xDS: introduce initial_fetch_timeout option to limit server initialization time

Signed-off-by: Marcin Falkowski marcin.falkowski@allegro.pl

Description:

Introduce new optional configuration parameter initial_fetch_timeout to ConfigSource proto.
This parameter can be used to limit time Envoy spend on initialization of CDS, LDS and RDS.
Enabling this timeout prevents Envoy from being stuck in PRE_INITIALIZING or INITIALIZING phase, as described in #5862.

Risk Level: Low (optional feature, disabled by default)
Testing: manual testing, unit tests
Docs Changes: add new parameter initial_fetch_timeout to ConfigSource proto
Release Notes: Added

Fixes #5862

…ation time

Signed-off-by: Marcin Falkowski <marcin.falkowski@allegro.pl>
@MarcinFalkowski MarcinFalkowski changed the title [WIP] xDS: introduce initial_fetch_timeout option to limit initialization time [wip] xds: introduce initial_fetch_timeout option to limit initialization time Feb 25, 2019
Signed-off-by: Marcin Falkowski <marcin.falkowski@allegro.pl>
Signed-off-by: Marcin Falkowski <marcin.falkowski@allegro.pl>
Signed-off-by: Marcin Falkowski <marcin.falkowski@allegro.pl>
@MarcinFalkowski MarcinFalkowski force-pushed the initial-fetch-timeout-sq branch from ae25c26 to e71fc4e Compare March 10, 2019 22:51
@MarcinFalkowski MarcinFalkowski changed the title [wip] xds: introduce initial_fetch_timeout option to limit initialization time xds: introduce initial_fetch_timeout option to limit initialization time Mar 10, 2019
source/common/config/delta_subscription_impl.h Outdated Show resolved Hide resolved
test/common/config/http_subscription_impl_test.cc Outdated Show resolved Hide resolved

typedef DeltaSubscriptionImpl<envoy::api::v2::ClusterLoadAssignment> DeltaEdsSubscriptionImpl;

class DeltaSubscriptionImplTest : public testing::Test {
Copy link
Member

Choose a reason for hiding this comment

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

I would advocate to factor this into harness/test as done for the other config tests. That way, we can reuse common tests (and write specialized ones where needed).

Copy link
Contributor Author

@MarcinFalkowski MarcinFalkowski Mar 13, 2019

Choose a reason for hiding this comment

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

I created delta subscription test harness and attached it to the common subscription tests in subscription_impl_test.cc.

source/common/router/rds_impl.cc Outdated Show resolved Hide resolved
Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Looks good, just some test questions mostly.

/wait

…ut-sq

Signed-off-by: Marcin Falkowski <marcin.falkowski@allegro.pl>
…ut-sq

Signed-off-by: Marcin Falkowski <marcin.falkowski@allegro.pl>
Signed-off-by: Marcin Falkowski <marcin.falkowski@allegro.pl>
Signed-off-by: Marcin Falkowski <marcin.falkowski@allegro.pl>
@MarcinFalkowski
Copy link
Contributor Author

@htuch should I add release notes for this change?

Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Sure, looks good, release notes would be great.

@@ -33,7 +33,11 @@ class FilesystemSubscriptionTestHarness : public SubscriptionTestHarness {
api_(Api::createApiForTest(stats_store_)), dispatcher_(api_->allocateDispatcher()),
subscription_(*dispatcher_, path_, stats_, *api_) {}

~FilesystemSubscriptionTestHarness() { EXPECT_EQ(0, ::unlink(path_.c_str())); }
~FilesystemSubscriptionTestHarness() {
if (::access(path_.c_str(), F_OK) != -1) {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed?

Copy link
Contributor Author

@MarcinFalkowski MarcinFalkowski Mar 14, 2019

Choose a reason for hiding this comment

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

I added a test, where deliverConfigUpdate is never called. So the config file is not even created, and unlink fails. All other tests call deliverConfigUpdate, so it was not a problem until now.

Signed-off-by: Marcin Falkowski <marcin.falkowski@allegro.pl>
Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@htuch htuch merged commit 0657644 into envoyproxy:master Mar 15, 2019
@MarcinFalkowski
Copy link
Contributor Author

Thanks!

spenceral added a commit to spenceral/envoy that referenced this pull request Mar 20, 2019
* master: (59 commits)
  http fault: add response rate limit injection (envoyproxy#6267)
  xds: introduce initial_fetch_timeout option to limit initialization time (envoyproxy#6048)
  test: fix cpuset-threads tests (envoyproxy#6278)
  server: add an API for registering for notifications for server instance life… (envoyproxy#6254)
  remove remains of TestBase (envoyproxy#6286)
  dubbo_proxy: Implement the routing of Dubbo requests (envoyproxy#5973)
  Revert "stats: add new BoolIndicator stat type (envoyproxy#5813)" (envoyproxy#6280)
  runtime: codifying runtime guarded features (envoyproxy#6134)
  mysql_filter: fix integration test flakes (envoyproxy#6272)
  tls: update BoringSSL to debed9a4 (3683). (envoyproxy#6273)
  rewrite buffer implementation to eliminate evbuffer dependency (envoyproxy#5441)
  Remove the dependency from TimeSystem to libevent by using the Event::Scheduler abstraction as a delegate. (envoyproxy#6240)
  fuzz: fix use of literal in default initialization. (envoyproxy#6268)
  http: add HCM functionality required for rate limiting (envoyproxy#6242)
  Disable mysql_integration_test until it is deflaked. (envoyproxy#6250)
  test: use ipv6_only IPv6 addresses in custom cluster integration tests. (envoyproxy#6260)
  tracing: If parent span is propagated with empty string, it causes th… (envoyproxy#6263)
  upstream: fix oss-fuzz issue envoyproxy#11095. (envoyproxy#6220)
  Wire up panic mode subset to receive updates (envoyproxy#6221)
  docs: clarify xds docs with warming information (envoyproxy#6236)
  ...
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