Skip to content

A failed stop/hibernate leaves every plugin marked stopped on a running instance (Cleanup's StopAll is not undone) #979

Closed

Description

@scttfrdmn

Found while fixing #948 (PR #977). Verified by reading the code; not reproduced live.

stop(), hibernate() and terminate() call Cleanup before the EC2 call. Cleanup calls pluginRuntime.StopAll, which stops each running plugin's health loop and persists StatusStopped. When the EC2 call then fails, the instance keeps running, but:

  • every plugin is recorded as stopped, so spawn plugin status reports it stopped;
  • its health loop is gone, so a plugin that later fails is never noticed or restarted.

#977 restores the DNS record and the hybrid-registry entry after a failed stop/hibernate (restoreAfterFailedStop). It does not restore plugins, because the runtime has no "resume" operation: StopAll keeps no record of what it stopped, and the persisted state does not hold the health spec needed to restart a loop.

Suggested fix: either split Cleanup, so plugins are stopped only after the provider accepted the stop (a guest that shuts down still gets the SIGTERM-path Cleanup), or give the runtime a way to restart what StopAll stopped and call it from restoreAfterFailedStop. The first is simpler but needs care for hibernate, where the guest is frozen rather than shut down.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions