auraed icon indicating copy to clipboard operation
auraed copied to clipboard

Graceful shutdown

Open MalteJ opened this issue 3 years ago • 1 comments

We need to implement a graceful shutdown flow. This flow must be executed when auraed gets a SIGTERM signal, the power button is pressed (if executed as pid 1) or when auraed gets a reboot or shutdown request via GRPC.

  1. An event has to be sent to all GRPC clients to inform them about the imminent shutdown.
  2. No new workloads (processes, containers, VMs, ...) may be scheduled.
  3. All threads, processes, containers, VMs, MicroVMs must be shut down gracefully (e.g. sending SIGTERM to processes, waiting for x seconds and then sending SIGKILL if they have not shut down; sending ACPI shutdown to VMs, power off after timeout).
  4. The GRPC API needs to be stopped.
  5. The API socket needs to be deleted.

MalteJ avatar Oct 01 '22 20:10 MalteJ

Using serve_with_incoming_shutdown, we can stop the GRPC server on a supplied signal.

It would replace: https://github.com/aurae-runtime/auraed/blob/809a488d8c36c45ccde88d4dc668d3cd5c085652/src/lib.rs#L141

future-highway avatar Oct 02 '22 02:10 future-highway