fix early deletion of wasm state schema #547
Conversation
Signed-off-by: Kuat Yessenov <kuat@google.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
How does it manifest in upper layers?
Previously this function did not return an error, what will the user see?
The return result changed, but it's not checked by metadata exchange plugin at the moment. Behaviourally it's the same as long as double registration happens to be identical. |
if (state_prototypes_.find(path) == state_prototypes_.end()) { | ||
state_prototypes_[path] = std::move(state_prototype); | ||
return WasmResult::Ok; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be bad argument only if the new and the old registration is different, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would require equality for the wasm prototypes. In general, it's not clear to me what to do if this method fails in the client. So the client should just log and ignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use this and issue an error if they are different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to get rid of protobuf as an argument eventually. The return result is currently ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM.
@PiotrSikora @jplevyak We need this in 1.6... |
Signed-off-by: Kuat Yessenov kuat@google.com
For an explanation of how to fill out the fields, please see the relevant section
in PULL_REQUESTS.md
Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Deprecated:]