Skip to content

spored restart leaves push-installed plugins recorded 'stopped' with no health loop while their services keep running #1559

Open

Description

@scttfrdmn

Problem

A graceful spored restart that is not an OS shutdown leaves every push-installed plugin marked stopped, with its health loop gone, while the plugin's services keep running. Nothing marks them running again until a reinstall.

Cases that hit this:

Evidence

Live (spawn#1557 verification, spore-host-dev, i-0188e697c28d22c4e, branch spored dba6fb6)

  1. spawn plugin install mountpoint-s3 → running (22:42:42Z).
  2. systemctl restart spored (22:45:06Z).
  3. spawn plugin list → mountpoint-s3 v1.0.1 stopped 2026-11-08T22:45:06Z, and docker was installed later.
  4. On the instance at the same time:
    • systemctl is-active mountpoint-s3 → active;
    • cat /mnt/s3/hello.txt returns the object.

So the state is wrong, and no health loop is watching the mount.

Code (main cc7b277)

  • pkg/agent/agent.go Cleanup calls pluginRuntime.StopAll(ctx) on every graceful stop.
  • StopAll (pkg/pluginruntime/runtime.go) sets each running or degraded plugin to StatusStopped and stops its health loop. It runs no stop steps, so the processes keep running.
  • ResumeStopped (A failed stop/hibernate leaves every plugin marked stopped on a running instance (Cleanup's StopAll is not undone) #979) undoes this only when a stop or hibernate that spored itself started fails. It is not called at startup.
  • At startup, newAgent only calls LoadFromDeclarations for /etc/spawn/plugins.json, which holds the launch-time declarations. Plugins installed through the push API (spawn plugin install) are not in that file, so they are never resumed.

Expected

After a spored restart on a still-running OS, a plugin that was running or degraded, and whose stop came from that agent shutdown, comes back with its previous status and its health loop. This is what ResumeStopped already does in-process. A real OS stop or reboot is a separate case: the services are actually down there, and the current stopped is correct.

Notes

This was found while live-verifying #1557. It has nothing to do with that PR's change.

Activity

  1. added this to the Hardening milestone on Nov 8, 2026
  2. added
    area:spored
    on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:sporedtype:bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions