Upgrading and stopping
The server migrates its database when it starts. Before the first release, an upgrade may need a fresh database. From the first release on, migrations only go forward and any newer version can start on an older version's database, even when versions are skipped. Back up Postgres before upgrading: there are no down migrations, so going back means restoring the backup.
Runner trust (KIL-198)
Runners are now protected or unprotected (Runner trust). The upgrade makes every runner and registration token from before protected: they take only default-branch and tag jobs. Pull requests' and other branches' jobs wait for an unprotected runner, so set HOD_RUNNER_TOKEN_UNPROTECTED or make a token with hod runner tokens create --trust unprotected, and start runners with it. A runner that ran pull requests on a machine of its own before must register again with an unprotected token (deregister it, delete its --state-dir, start it again): otherwise it now takes release jobs.
Stopping
On SIGTERM or Ctrl-C the server stops taking connections, ends live log streams and runner long polls at once (hod logs -f and runners reconnect on their own), and gives other requests in flight HOD_SHUTDOWN_TIMEOUT (25 s) to finish before it drops them. Give it longer than that before a SIGKILL: Compose's stop_grace_period (30 s in compose.yaml; docker stop alone waits 10 s), or Kubernetes' terminationGracePeriodSeconds (30 s by default), which must also cover any preStop sleep.
The server also stops, with an error and a non-zero exit, if one of its background loops (webhooks, statuses, leases, schedules, cache and log clean-up) panics or ends: run it under a restart policy (Compose's restart: unless-stopped, systemd's Restart=on-failure, Kubernetes restarts it anyway). Every loop picks up where it left off from the database.