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

config: remove ApiTypeOracle assert #9973

Merged
merged 5 commits into from
Feb 10, 2020

Conversation

rebello95
Copy link
Contributor

@rebello95 rebello95 commented Feb 8, 2020

This assert currently validates that the return value is non-null. However, call sites actually guard against nullptr and treat it as a valid codepath.

In Envoy Mobile, we're hitting this assert because we use the v3 configuration and don't include all the v2 protos when building the library. Removing the v2 fallback protos in this scenario can be a valid optimization.

Given the above example and the fact that callers explicitly guard against nullptr, this assert should be removed and this codepath considered valid.

Risk Level: Low
Testing: Built Envoy / Envoy Mobile locally + CI
Docs Changes: None
Release Notes: None

Signed-off-by: Michael Rebello me@michaelrebello.com

This assert currently validates that the return value is non-null. However, call sites actually [guard against `nullptr`](https://github.com/envoyproxy/envoy/pull/9618/files#diff-17967d56376bf9821edb17b67b8a7e63R228-R230) and treat it as a valid codepath.

In Envoy Mobile, we're hitting this assert because we use the v3 configuration and don't include all the v2 protos when building the library. Removing the v2 fallback protos in this scenario can be a valid optimization.

Given the above example and the fact that callers explicitly guard against `nullptr`, this assert should be removed and this codepath considered valid.

Signed-off-by: Michael Rebello <me@michaelrebello.com>
@rebello95
Copy link
Contributor Author

CI failure seems unrelated

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Cool, thanks. Small cleanup ask if you don't mind.

/wait

source/common/config/api_type_oracle.cc Show resolved Hide resolved
Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: Michael Rebello <me@michaelrebello.com>
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks!

@mattklein123 mattklein123 merged commit f103f90 into envoyproxy:master Feb 10, 2020
@rebello95 rebello95 deleted the oracle-assert branch February 10, 2020 18:10
rebello95 added a commit to envoyproxy/envoy-mobile that referenced this pull request Feb 10, 2020
Bumping to include the following fixes:
- `dns: destroy/reinitialize c-ares channel on ARES_ECONNREFUSED`: envoyproxy/envoy#9899. This should resolve the issues we've been seeing with Envoy Mobile hanging on startup and never properly issuing requests if started in the offline state on iOS. Fixes #672, though more improvements to DNS resolution will be investigated in #673
- `gzip: add force load factory declaration`: envoyproxy/envoy#9942. This will allow us to use the gzip filter with Envoy Mobile
- `api listener: add shutdown method and call during server termination`: envoyproxy/envoy#9959. Fixes #667. Fixes #674

Includes the following PRs to fix iOS liveliness tests as well:
- `metrics service: force link v2 config`: envoyproxy/envoy#9875
- `config: remove ApiTypeOracle assert`: envoyproxy/envoy#9973

Also contains necessary updates to accommodate [this change](envoyproxy/envoy@dea4eb0).

Signed-off-by: Michael Rebello <me@michaelrebello.com>
jpsim pushed a commit that referenced this pull request Nov 28, 2022
Bumping to include the following fixes:
- `dns: destroy/reinitialize c-ares channel on ARES_ECONNREFUSED`: #9899. This should resolve the issues we've been seeing with Envoy Mobile hanging on startup and never properly issuing requests if started in the offline state on iOS. Fixes envoyproxy/envoy-mobile#672, though more improvements to DNS resolution will be investigated in envoyproxy/envoy-mobile#673
- `gzip: add force load factory declaration`: #9942. This will allow us to use the gzip filter with Envoy Mobile
- `api listener: add shutdown method and call during server termination`: #9959. Fixes envoyproxy/envoy-mobile#667. Fixes envoyproxy/envoy-mobile#674

Includes the following PRs to fix iOS liveliness tests as well:
- `metrics service: force link v2 config`: #9875
- `config: remove ApiTypeOracle assert`: #9973

Also contains necessary updates to accommodate [this change](dea4eb0).

Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this pull request Nov 29, 2022
Bumping to include the following fixes:
- `dns: destroy/reinitialize c-ares channel on ARES_ECONNREFUSED`: #9899. This should resolve the issues we've been seeing with Envoy Mobile hanging on startup and never properly issuing requests if started in the offline state on iOS. Fixes envoyproxy/envoy-mobile#672, though more improvements to DNS resolution will be investigated in envoyproxy/envoy-mobile#673
- `gzip: add force load factory declaration`: #9942. This will allow us to use the gzip filter with Envoy Mobile
- `api listener: add shutdown method and call during server termination`: #9959. Fixes envoyproxy/envoy-mobile#667. Fixes envoyproxy/envoy-mobile#674

Includes the following PRs to fix iOS liveliness tests as well:
- `metrics service: force link v2 config`: #9875
- `config: remove ApiTypeOracle assert`: #9973

Also contains necessary updates to accommodate [this change](dea4eb0).

Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: JP Simard <jp@jpsim.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.

2 participants