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

http: add core retry policy to route retry policy conversion utility #17803

Merged
merged 16 commits into from
Sep 28, 2021

Conversation

Shikugawa
Copy link
Member

Signed-off-by: Shikugawa rei@tetrate.io

Commit Message: The conversion from core::RetryPolicy to route::RetryPolicy is essential for basic stream option setup. But in current impl, that is isolated on JWK fetcher and needed to use #17469. This refactor includes to the solution of them.
Additional Description:
Risk Level: Low
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Deprecated:]
[Optional API Considerations:]

Signed-off-by: Shikugawa <rei@tetrate.io>
Signed-off-by: Shikugawa <rei@tetrate.io>
Signed-off-by: Shikugawa <rei@tetrate.io>
@Shikugawa Shikugawa changed the title http: refactor core retry policy config on stream options http: enable to configure core retry policy as stream options Aug 23, 2021
Copy link
Member

@mathetake mathetake left a comment

Choose a reason for hiding this comment

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

overall looks good to me.

envoy/http/async_client.h Outdated Show resolved Hide resolved
@lizan lizan removed their assignment Aug 25, 2021
@lizan
Copy link
Member

lizan commented Aug 25, 2021

/assign-from @envoyproxy/maintainers

for non-Tetrands review

@repokitteh-read-only
Copy link

@envoyproxy/maintainers assignee is @jmarantz

🐱

Caused by: a #17803 (comment) was created by @lizan.

see: more, trace.

Signed-off-by: Shikugawa <rei@tetrate.io>
…tor-backoff-setup

Signed-off-by: Shikugawa <rei@tetrate.io>
@jmarantz
Copy link
Contributor

I assigned Ryan as a "first pass reviewer" to look at this PR first, then I can look at it next. This way we get more review mileage from prospective maintainers.

Copy link
Contributor

@RyanTheOptimist RyanTheOptimist left a comment

Choose a reason for hiding this comment

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

It looks like this code is moving from JwksFetcher to AsyncClient. However, AsyncClient lives in envoy/ and has very little logic. In general, envoy/ has basic structs and interfaces, but code lives elsewhere. The existing setRetryPolicy() method on AsynClient is a trivial setter which seems reasonable. This new method is quite non-trivial by comparison. I'm not sure this is a good fit for a place to live.

The bulk of the new method appears to be making a new route::RetryPolcy from core::RetryPolicy and configuring retries on it. Perhaps an alternative would be to write a method like:

route::RetryPolicy createRouteRetryPolicy(const core::retryPolicy& policy, bool retry_on);

This could be a static helper method somewhere. It would be good to write unit tests for this method too, I think. (The new method being added to AsyncClient has no tests, but the code in envoy/ typically doesn't because it's usually all trivial). What do you think?

The coverage appears to be failing. Do you know why?

envoy/http/async_client.h Outdated Show resolved Hide resolved
envoy/http/async_client.h Outdated Show resolved Hide resolved
@lizan lizan added the waiting label Aug 30, 2021
Signed-off-by: Shikugawa <rei@tetrate.io>
Signed-off-by: Shikugawa <rei@tetrate.io>
@Shikugawa Shikugawa changed the title http: enable to configure core retry policy as stream options http: add core retry policy to route retry policy conversion utility Sep 4, 2021
Copy link
Contributor

@RyanTheOptimist RyanTheOptimist left a comment

Choose a reason for hiding this comment

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

Two small comments, but looks good otherwise.

envoy/http/async_client.h Outdated Show resolved Hide resolved
source/common/http/utility.cc Outdated Show resolved Hide resolved
@jmarantz jmarantz assigned lizan and unassigned jmarantz Sep 15, 2021
@Shikugawa
Copy link
Member Author

@lizan Could you take a look?

lizan
lizan previously approved these changes Sep 17, 2021
@lizan
Copy link
Member

lizan commented Sep 17, 2021

@jmarantz mind doing a non-tetrands check?

jmarantz
jmarantz previously approved these changes Sep 21, 2021
Copy link
Contributor

@jmarantz jmarantz left a comment

Choose a reason for hiding this comment

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

lgtm modulo one nit/question.

source/common/http/utility.cc Show resolved Hide resolved
test/common/http/utility_test.cc Outdated Show resolved Hide resolved
Signed-off-by: Shikugawa <rei@tetrate.io>
@Shikugawa Shikugawa dismissed stale reviews from jmarantz and lizan via 9a44698 September 22, 2021 15:26
Signed-off-by: Shikugawa <rei@tetrate.io>
Signed-off-by: Shikugawa <rei@tetrate.io>
jmarantz
jmarantz previously approved these changes Sep 24, 2021
Copy link
Contributor

@jmarantz jmarantz left a comment

Choose a reason for hiding this comment

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

just a few nits, but I'll pass off to senior maintainers.

/assign-from @envoyproxy/senior-maintainers

source/extensions/filters/http/common/jwks_fetcher.cc Outdated Show resolved Hide resolved
test/common/http/utility_test.cc Outdated Show resolved Hide resolved
test/common/http/utility_test.cc Outdated Show resolved Hide resolved
test/common/http/utility_test.cc Outdated Show resolved Hide resolved
@repokitteh-read-only
Copy link

@envoyproxy/senior-maintainers assignee is @lizan

🐱

Caused by: a #17803 (review) was submitted by @jmarantz.

see: more, trace.

Signed-off-by: Shikugawa <rei@tetrate.io>
@Shikugawa
Copy link
Member Author

/retest

@repokitteh-read-only
Copy link

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

🐱

Caused by: a #17803 (comment) was created by @Shikugawa.

see: more, trace.

@Shikugawa
Copy link
Member Author

/retest

@repokitteh-read-only
Copy link

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

🐱

Caused by: a #17803 (comment) was created by @Shikugawa.

see: more, trace.

@Shikugawa
Copy link
Member Author

/retest

@repokitteh-read-only
Copy link

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

🐱

Caused by: a #17803 (comment) was created by @Shikugawa.

see: more, trace.

Copy link
Contributor

@jmarantz jmarantz left a comment

Choose a reason for hiding this comment

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

Sorry this has bounced back & forth a few times :). I think we are all good on this PR if we can coax it through CI. It's failing on 2 tests in the context of coverage, which I've seen fail on other PRs also.

@jmarantz
Copy link
Contributor

/retest

@repokitteh-read-only
Copy link

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

🐱

Caused by: a #17803 (comment) was created by @jmarantz.

see: more, trace.

@jmarantz jmarantz merged commit 9f80d2c into envoyproxy:main Sep 28, 2021
@Shikugawa Shikugawa deleted the refactor-backoff-setup branch September 28, 2021 23:14
mpuncel added a commit to mpuncel/envoy that referenced this pull request Oct 29, 2021
* main: (114 commits)
  kafka: add header support to mesh-filter (envoyproxy#18248)
  rbac: add support for upstream ip policy. (envoyproxy#17645)
  SIPProxy BUGFIX UT failure for fastbuild/debug (envoyproxy#18303)
  quic: updating goaway code (envoyproxy#18291)
  various tiny fixes (envoyproxy#18287)
  dns cache: remove assert at this layer (envoyproxy#18301)
  [ext_authz]: ext_authz filter unit test that use real threading (envoyproxy#17742)
  signal action: fully disable sigaltstack on Apple (envoyproxy#18299)
  Add missing dependencies (envoyproxy#18297)
  ext_proc: Pass stream_info to gRPC streams (envoyproxy#18190)
  use clang 12 (envoyproxy#18220)
  Update PR template to include the "Fixes commit" message when reverting or fixing bad commits (envoyproxy#18298)
  [test] Fixing integration test to cleanup cleanly (envoyproxy#18293)
  test: moving grpc bridge tests out of core directory (envoyproxy#18227)
  runtime: disable deprecated extensions names by default (envoyproxy#18239)
  quiche: updating deps (envoyproxy#18272)
  sip_proxy: SIP protocol support in envoy (envoyproxy#18039)
  http: add core retry policy to route retry policy conversion utility (envoyproxy#17803)
  build: updating stale visibility (envoyproxy#18278)
  alternate_protocols_cache: Impose a max size limit on the alternate protocols cache (envoyproxy#18258)
  ...

Signed-off-by: Michael Puncel <mpuncel@squareup.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.

7 participants