Skip to content

Reuse the ConfigImpl held by RdsRouteConfigProviderImpl in SRDS#18241

Merged
yanavlasov merged 2 commits intoenvoyproxy:mainfrom
stevenzzzz:reuse_config_impl_in_srds
Sep 24, 2021
Merged

Reuse the ConfigImpl held by RdsRouteConfigProviderImpl in SRDS#18241
yanavlasov merged 2 commits intoenvoyproxy:mainfrom
stevenzzzz:reuse_config_impl_in_srds

Conversation

@stevenzzzz
Copy link
Copy Markdown
Contributor

@stevenzzzz stevenzzzz commented Sep 23, 2021

Signed-off-by: Xin Zhuang stevenzzz@google.com
See details in #18240

Commit Message: Reuse the ConfigImpl from RDS config provider in SRDS.
Additional Description:
Risk Level: LOW, refactor
Testing: reuse existing tests.
Docs Changes:
Release Notes:

Signed-off-by: Xin Zhuang <stevenzzz@google.com>
@stevenzzzz
Copy link
Copy Markdown
Contributor Author

/assign @chaoqin-li1123 Chaoqin could you take a first pass pls?

@repokitteh-read-only
Copy link
Copy Markdown

🙀 Error while processing event:

evaluation error
error: function _rk_error error: path contains forbidden characters:
 Traceback (most recent call last):
  bootstrap:143: in <toplevel>
  bootstrap:135: in _main
  bootstrap:62: in _call
  bootstrap:15: in _call1
  github.com/repokitteh/modules/assign.star:18: in _assign
  github:395: in issue_check_assignee
  github:131: in call
Error: function _rk_error error: path contains forbidden characters
🐱

Caused by: a #18241 (comment) was created by @stevenzzzz.

see: more, trace.

@stevenzzzz
Copy link
Copy Markdown
Contributor Author

/assign @chaoqin-li1123

rds_subscription.routeConfigUpdate()->protobufConfiguration(), optional_http_filters_,
factory_context_, factory_context_.messageValidationContext().dynamicValidationVisitor(),
false));
new_rds_config);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we move the new_rds_config here?

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.

we can. there is little gain in move a shared_ptr.
I just found it a little bit confusing in the original way, but no strong opinion.

@stevenzzzz
Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #18241 (comment) was created by @stevenzzzz.

see: more, trace.

Signed-off-by: Xin Zhuang <stevenzzz@google.com>
@stevenzzzz
Copy link
Copy Markdown
Contributor Author

/assign @yanavlasov
hi Yan, could you pls take a look?

envoy::config::route::v3::ScopedRouteConfiguration(iter->second->configProto()),
std::make_shared<ConfigImpl>(
rds_subscription.routeConfigUpdate()->protobufConfiguration(), optional_http_filters_,
factory_context_, factory_context_.messageValidationContext().dynamicValidationVisitor(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you confirm the Config doesn't hold a factory_context_ from another networkfilterchain/listener?
Reuse a protobuf nessage is pretty safe but Config is risk when the config is shared among different filter chain. There were a lot of issues

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think they all use the factory_context_ of ScopedRdsConfigSubscription.

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.

yeah, this rds-config-provider was fully owned by the SRDS subscription, the factory_context_ is from ScopedRdsConfigSubscription, see how RdsRouteConfigProviderHelper::initRdsConfigProvider works, which is inherited from the listener that started the srds subscription.
the life-cycle of these objects are:
{SRDS-subscription { RDS-subscription, RDS-CofigProvider } }
so it should be fine.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thank you for hte explanation!

@lambdai
Copy link
Copy Markdown
Contributor

lambdai commented Sep 24, 2021

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #18241 (comment) was created by @lambdai.

see: more, trace.

@stevenzzzz
Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #18241 (comment) was created by @stevenzzzz.

see: more, trace.

@yanavlasov yanavlasov merged commit c8cf16f into envoyproxy:main Sep 24, 2021
soulxu pushed a commit to soulxu/envoy that referenced this pull request Oct 16, 2021
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