Skip to content

Configuration canary for the second or further plugins. #289

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

Merged
merged 26 commits into from
Jul 31, 2022

Conversation

ingwonsong
Copy link
Contributor

Fixes: #175

Applying Configuration Canary for second or further plugin.

In #175, there are some discussion about 1) needs of optimization for multiple plugins, and 2) the initialization in the main thread.

But, before making such optimization, this PR proposes to solve the issue itself because it seems to be critical in terms of stability.

@ingwonsong ingwonsong force-pushed the canary-second branch 2 times, most recently from a68b9ac to 0da9fd0 Compare June 14, 2022 18:42
@ingwonsong
Copy link
Contributor Author

@mathetake @PiotrSikora Friendly ping.

@PiotrSikora
Copy link
Member

PiotrSikora commented Jun 16, 2022

Can you add tests?

Also, the recent issue was a single plugin with multiple configurations (one valid, one invalid), but this is talking about multiple plugins, so it's unclear which case you are trying to address.

@ingwonsong
Copy link
Contributor Author

ingwonsong commented Jun 16, 2022

Also, the recent issue was a single plugin with multiple configurations (one valid, one invalid), but this is talking about multiple plugins, so it's unclear which case you are trying to address.

I thought that the multiple filters with the same WasmVM was problematic: envoyproxy/envoy#20843 (comment)

In my understanding, Plugin is created per filter config (per configuration), while Wasm base handle (before cloning per thread) is created per vm_key. Isn't it right?

@PiotrSikora
Copy link
Member

I thought that the multiple filters with the same WasmVM was problematic: envoyproxy/envoy#20843 (comment)

In my understanding, Plugin is created per filter config (per configuration), while Wasm base handle (before cloning per thread) is created per vm_key. Isn't it right?

That's the issue with different instances of the same Wasm plugin (i.e. when same was plugin is started with different plugin configuration).

However, #175 (which this PR supposedly resolves) is about multiple Wasm plugins linked in the same Wasm module, which I don't belive this fixes.

@ingwonsong
Copy link
Contributor Author

Oh.. "multiple Wasm plugin" means a kind of multiple type? (like network, http, bootstrap)

According to #175 (comment), #175 seems to be about that "canary" is not applied to the second plugin instance when vm_key is the same.

@ingwonsong ingwonsong force-pushed the canary-second branch 3 times, most recently from da5fba7 to 73caefd Compare July 1, 2022 21:52
@PiotrSikora
Copy link
Member

@ingwonsong you need to add rule to build wasm_cc_binary targets in test_data step on the CI (.github/workflows/test.yml).

@chaoqin-li1123 @mpwarres could you do the first review pass? Thank you.

Copy link
Member

@PiotrSikora PiotrSikora left a comment

Choose a reason for hiding this comment

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

@ingwonsong could you update Proxy-Wasm C++ SDK to latest as part of this PR?

Signed-off-by: Ingwon Song <igsong@google.com>
Signed-off-by: Ingwon Song <igsong@google.com>
Signed-off-by: Ingwon Song <igsong@google.com>
Signed-off-by: Ingwon Song <igsong@google.com>
Signed-off-by: Ingwon Song <igsong@google.com>
Signed-off-by: Ingwon Song <igsong@google.com>
Signed-off-by: Ingwon Song <igsong@google.com>
@ingwonsong
Copy link
Contributor Author

@ingwonsong could you update Proxy-Wasm C++ SDK to latest as part of this PR?

Done.

@ingwonsong
Copy link
Contributor Author

@ingwonsong you need to add rule to build wasm_cc_binary targets in test_data step on the CI (.github/workflows/test.yml).

Done, too.

Signed-off-by: Ingwon Song <igsong@google.com>
@ingwonsong ingwonsong force-pushed the canary-second branch 2 times, most recently from 2575f73 to a28ee34 Compare July 14, 2022 22:22
Copy link
Contributor

@mpwarres mpwarres left a comment

Choose a reason for hiding this comment

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

LG, thanks!

@ingwonsong
Copy link
Contributor Author

@PiotrSikora Wam reminder. :)

Signed-off-by: Ingwon Song <igsong@google.com>
…tion

Signed-off-by: Ingwon Song <igsong@google.com>
…t_data

Signed-off-by: Ingwon Song <igsong@google.com>
Signed-off-by: Ingwon Song <igsong@google.com>
Signed-off-by: Ingwon Song <igsong@google.com>
@ingwonsong
Copy link
Contributor Author

@PiotrSikora Can you take a look once again? :)

Copy link
Member

@PiotrSikora PiotrSikora left a comment

Choose a reason for hiding this comment

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

LGTM, with a few small comments/nits.

Signed-off-by: Ingwon Song <igsong@google.com>
Signed-off-by: Ingwon Song <igsong@google.com>
Signed-off-by: Ingwon Song <igsong@google.com>
Copy link
Member

@PiotrSikora PiotrSikora left a comment

Choose a reason for hiding this comment

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

All three YamlLoadFromFileWasmInvalidConfig tests in Envoy are failing because of this change, which is a bit unexpected. Could you take a look?

Ideally, you would open a draft PR in Envoy pointing to this unmerged branch.

@ingwonsong
Copy link
Contributor Author

All three YamlLoadFromFileWasmInvalidConfig tests in Envoy are failing because of this change, which is a bit unexpected. Could you take a look?

Ideally, you would open a draft PR in Envoy pointing to this unmerged branch.

Sure. will take a look

@ingwonsong
Copy link
Contributor Author

@PiotrSikora

Can you check out the behavioral difference in the fixed envoy test cases?
https://github.com/envoyproxy/envoy/pull/22469/files

TL;DR - now we always apply canary, so the creation of FilterConfig or AccessLog should raise the exception always when the invalid config is configured.

Signed-off-by: Ingwon Song <igsong@google.com>
Copy link
Member

@PiotrSikora PiotrSikora left a comment

Choose a reason for hiding this comment

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

Thanks!

@PiotrSikora PiotrSikora changed the title Configuration Canary for the second or further plugins Configuration canary for the second or further plugins. Jul 31, 2022
@PiotrSikora PiotrSikora merged commit 4ddbed3 into proxy-wasm:master Jul 31, 2022
@ingwonsong ingwonsong deleted the canary-second branch July 31, 2022 15:17
knm3000 pushed a commit to knm3000/proxy-wasm-cpp-host that referenced this pull request Aug 17, 2022
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.

Configuration canary is only created for the first plugin of VMs
4 participants