-
Notifications
You must be signed in to change notification settings - Fork 101
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
How to execute something just before the instance is terminated? #205
Comments
Did you try |
Good afternoon @PiotrSikora I had tried with However, during testing, I found something strange and I have a question. It seems that 2 plugins are started, or the same one was started 2 times. At the start of the plugin, I create a UUID and assign it to it. So in the log, it shows that 2 UUIDs are starting, but after that, only 1 continues to execute. Have you ever encountered something like this? I will leave the code I used for the example and the envoy file. Plugin Wasm
Envoy File
Logs
|
|
Is there any way I can differentiate between these two flows in |
Is the |
Unfortunately, currently it's not (I agree that's not great). Note that both canary and "regular" plugin are started in the same WasmVM, so you could store some state in global variables within the plugin, but keep in mind that the same WasmVM is also reused across multiple instances of the same plugin with different plugin configurations, so you'd need to account for that. |
Yes. |
A question about singleton plugins.
I need to execute a process whenever a new instance of my application is created, and another whenever that instance dies. Since each instance has an envoy sidecar, I thought about adding the first logic to
on_vm_start
, but I couldn't find a way to add anon_delete
or something that is executed before the instance is finalized.I tried implementing it through the
RootContext
, but I couldn't find anything that worked. Example:Is it possible to do something like this?
The text was updated successfully, but these errors were encountered: