wasm: fix root_context_id that was incorrectly cached across threads.#15016
Merged
lizan merged 8 commits intoenvoyproxy:mainfrom Feb 17, 2021
Merged
wasm: fix root_context_id that was incorrectly cached across threads.#15016lizan merged 8 commits intoenvoyproxy:mainfrom
lizan merged 8 commits intoenvoyproxy:mainfrom
Conversation
Fixes proxy-wasm/proxy-wasm-cpp-host#125. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
Contributor
Author
Contributor
Author
|
/backport |
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
bianpengyuan
previously approved these changes
Feb 10, 2021
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
Contributor
antoniovicente
left a comment
There was a problem hiding this comment.
drive by comments.
mathetake
reviewed
Feb 11, 2021
| } | ||
| if (plugin_->fail_open_ && (!wasm || wasm->isFailed())) { | ||
| return nullptr; | ||
| if (!wasm || wasm->isFailed()) { |
Member
There was a problem hiding this comment.
question: is this change something to do with #14947?
Contributor
Author
There was a problem hiding this comment.
No, there are functional changes here, only style.
Previously, we had:
if (plugin_->fail_open_ && (!wasm || wasm->isFailed())) {
return nullptr;
}
which handled the fail open case, and
return std::make_shared<Context>(wasm, root_context_id_, plugin_);
which handled both the valid case, and the fail closed case (where wasm == nullptr and the rest didn't matter).
I've split the latter to make it more readable, since the new version is:
return std::make_shared<Context>(wasm, handle->configId(), plugin_);
and handle isn't valid in the fail closed case.
Alternatively, I could undo the style changes and turn this into:
return std::make_shared<Context>(wasm, handle.has_value() ? handle->configId() : 0, plugin_);
but that seems more confusing than having separate codepath.
Let me know what you prefer.
mathetake
reviewed
Feb 11, 2021
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
Contributor
Author
|
@envoyproxy/dependency-shepherds PTAL |
Contributor
|
/lgtm deps |
lizan
approved these changes
Feb 17, 2021
PiotrSikora
added a commit
to PiotrSikora/envoy
that referenced
this pull request
Feb 17, 2021
…envoyproxy#15016) Fixes proxy-wasm/proxy-wasm-cpp-host#125. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
lizan
pushed a commit
that referenced
this pull request
Feb 19, 2021
…#15016) (#15078) Fixes proxy-wasm/proxy-wasm-cpp-host#125. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes proxy-wasm/proxy-wasm-cpp-host#125.
Signed-off-by: Piotr Sikora piotrsikora@google.com