pub struct KillState { /* private fields */ }
Expand description
All instance state a remote kill switch needs to determine if and how to signal that execution should stop.
Some definitions for reference in this struct’s documentation:
- “stopped” means “stop executing at some point before reaching the end of the entrypoint wasm function”.
- “critical section” means what it typically means - an uninterruptable region of code. The detail here is that currently “critical section” and “hostcall” are interchangeable, but in the future this may change. Hostcalls may one day be able to opt out of criticalness, or perhaps guest code may include critical sections.
“Stopped” is a particularly loose word here because it encompasses the worst case: trying to
stop a guest that is currently in a critical section. Because the signal will only be checked
when exiting the critical section, the latency is bounded by whatever embedder guarantees are
made. In fact, it is possible for a kill signal to be successfully sent and still never
impactful, if a hostcall itself invokes lucet_hostcall_terminate!
. In this circumstance, the
hostcall would terminate the instance if it returned, but lucet_hostcall_terminate!
will
terminate the guest before the termination request would even be checked.