Skip to content

NullVm: fix bugs when linking with Rust SDK. #141

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

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion include/proxy-wasm/wasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,11 @@ class WasmHandleBase : public std::enable_shared_from_this<WasmHandleBase> {
}
}

void kill() { wasm_base_ = nullptr; }
void kill() {
wasm_base_->startShutdown();
wasm_base_->finishShutdown();
wasm_base_ = nullptr;
Copy link
Member

Choose a reason for hiding this comment

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

Calling finishShutdown() immediatelly after startShutdown(), without waiting for the plugin to call proxy_done is technically incorrect, and effectlively a no-op. This sequence works only if the plugin returns true from the proxy_on_done callback, in which case you don't even need to call finishShutdown().

It also breaks the promise of not executing anything in the canary (e.g. you can imagine plugins sending batch reports on shutdown, etc.), which is why we're simply dropping the VM right now.

}

std::shared_ptr<WasmBase> &wasm() { return wasm_base_; }

Expand Down