Skip to content

Health checks are not wired to the state machine — ready?/0 reports true when Caddy is down #9

Description

@gsmlg

Problem

Caddy.ConfigManager.report_health_status/1 (lib/caddy/config_manager.ex:343) exists to drive the :synced → :degraded state transition, but nothing ever calls it.

Caddy.Server.External.do_health_check/1 (lib/caddy/server/external.ex:290) tracks Caddy status in its own GenServer state and emits telemetry, but never notifies ConfigManager.

Impact

  • Caddy.ready?/0 returns true even when Caddy is unreachable
  • The :degraded state defined in Caddy.State is unreachable in practice (dead code)

Fix

Call ConfigManager.report_health_status(:ok | :error) from Server.External.do_health_check/1 on status changes, so the application state machine reflects actual Caddy health.

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions