Skip to content
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

Lifecycle bug in WASM filter #35882

Closed
yanavlasov opened this issue Aug 28, 2024 · 2 comments · Fixed by #36688
Closed

Lifecycle bug in WASM filter #35882

yanavlasov opened this issue Aug 28, 2024 · 2 comments · Fixed by #36688
Assignees
Labels
area/wasm bug stale stalebot believes this issue/PR has not been touched recently

Comments

@yanavlasov
Copy link
Contributor

The shutdownExit envent handler should be held until at least when the registered callback is called:

fyi, this function may has a bug:

void Wasm::initializeLifecycle(Server::ServerLifecycleNotifier& lifecycle_notifier) {
  auto weak = std::weak_ptr<Wasm>(std::static_pointer_cast<Wasm>(shared_from_this()));
  lifecycle_notifier.registerCallback(Server::ServerLifecycleNotifier::Stage::ShutdownExit,
                                      [this, weak](Event::PostCb post_cb) {
                                        auto lock = weak.lock();
                                        if (lock) { // See if we are still alive.
                                          server_shutdown_post_cb_ = std::move(post_cb);
                                        }
                                      });
}

because the comment of registerCallback says the caller should keep the return value(HandlePtr) of registerCallback. Otherwise the callback is unregistered when the return value is deleted.

@yanavlasov yanavlasov added bug triage Issue requires triage area/wasm and removed triage Issue requires triage labels Aug 28, 2024
Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Sep 27, 2024
Copy link

github-actions bot commented Oct 4, 2024

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 4, 2024
yanavlasov pushed a commit that referenced this issue Nov 5, 2024
Commit Message: wasm: remove the shutdown callback in lifetime_notifier
Fixes: #35882

---------

Signed-off-by: Boteng Yao <boteng@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/wasm bug stale stalebot believes this issue/PR has not been touched recently
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants