Skip to content

Configuration canary for the second or further plugins. - #289

Merged
PiotrSikora merged 26 commits into
proxy-wasm:masterfrom
ingwonsong:canary-second
Jul 31, 2022
Merged

PiotrSikora merged 26 commits into
proxy-wasm:masterfrom
ingwonsong:canary-second

Conversation

@ingwonsong

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

@mathetake @PiotrSikora Friendly ping.

@PiotrSikora

PiotrSikora commented Jun 16, 2022 •

Copy link
Copy Markdown
Member

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

ingwonsong commented Jun 16, 2022 •

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@PiotrSikora PiotrSikora left a comment

Copy link
Copy Markdown
Member

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?

Comment thread src/wasm.cc Resolved
Comment thread src/wasm.cc Resolved
Comment thread src/wasm.cc Resolved
Comment thread test/utility.h Resolved
@ingwonsong

Copy link
Copy Markdown
Contributor Author

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

Done.

@ingwonsong

Copy link
Copy Markdown
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.

@ingwonsong
ingwonsong force-pushed the canary-second branch 2 times, most recently from 2575f73 to a28ee34 Compare July 14, 2022 22:22

@mpwarres mpwarres left a comment

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.

LG, thanks!

@ingwonsong

Copy link
Copy Markdown
Contributor Author

@PiotrSikora Wam reminder. :)

Comment thread src/wasm.cc Resolved
Comment thread test/wasm_test.cc Resolved
Comment thread test/test_data/configure_check.cc Resolved
Comment thread test/wasm_test.cc Resolved
Comment thread .github/workflows/test.yml Resolved
Comment thread .github/workflows/test.yml Resolved
Comment thread test/utility.h Resolved
Signed-off-by: Ingwon Song <[email protected]>
@ingwonsong

Copy link
Copy Markdown
Contributor Author

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

@PiotrSikora PiotrSikora left a comment

Copy link
Copy Markdown
Member

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.

Comment thread test/utility.h Resolved
Comment thread test/wasm_test.cc Resolved
Comment thread test/wasm_test.cc Resolved
Comment thread test/test_data/BUILD Resolved
Comment thread test/test_data/configure_check.cc Resolved
Comment thread test/wasm_test.cc Resolved
Comment thread test/utility.cc Resolved

@PiotrSikora PiotrSikora left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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

Comment thread .github/workflows/test.yml Resolved
Comment thread .github/workflows/test.yml Resolved
@ingwonsong

Copy link
Copy Markdown
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 <[email protected]>

@PiotrSikora PiotrSikora left a comment

Copy link
Copy Markdown
Member

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