Skip to content

fix: add durable runtime reconciliation #12

Closed

Description

@RentnerKev

Summary

Make RentnerProxy automatically recover when Desired State could not be applied because the controller/runtime was temporarily unavailable.

Today the in-process reconciler retries only for a limited period. A failed apply can remain pending indefinitely until another user action triggers reconciliation.

Beta 1 should self-heal.

Required Behavior

When:

PostgreSQL Desired State
!=
Controller/OpenResty Active State

RentnerProxy must eventually retry automatically.

Examples:

  • controller temporarily unavailable
  • OpenResty temporarily unavailable
  • transient networking issue
  • temporary apply failure
  • application restarted while state is pending

Scope

  • durable/persistent knowledge that reconciliation is required
  • bounded backoff
  • startup healing
  • single-flight reconciliation
  • safe concurrency
  • existing revision semantics
  • clear pending / failed / active state
  • manual retry if useful
  • no infinite tight retry loops
  • no duplicate concurrent applies

Acceptance Criteria

  • pending state survives Web restart where required
  • controller recovery automatically triggers reconciliation
  • startup detects unapplied desired state
  • successful retry clears pending state
  • permanent config error does not create a busy loop
  • last-known-good traffic remains active after failed apply
  • tests cover restart and temporary controller failure

Dependency

Follows #11. Production smoke integration may proceed in parallel where independent.

Activity

  1. added this to the v1.0.0-beta.1 milestone on Sep 3, 2026
  2. added
    enhancement
    area: runtime
    on Sep 3, 2026
  3. RentnerKev commented on Sep 8, 2026

    @RentnerKev
    MemberAuthor

    Implemented in 755e7d5, verified on main.

    The durable source is PostgreSQL desired state. A single Web worker reads it at startup, coalesces concurrent changes, retries failed applies with 1–60 second backoff, and checks for drift without reapplying a healthy runtime. Caller deadlines return pending while the owned worker continues. Shutdown stops new applies and drains the in-flight operation.

    Real proxy smoke checks now stop the controller, commit a desired-state change, and verify automatic reconciliation after recovery without a manual apply. A separate freshly started Web worker process also restores persisted pending state without a user request. The status changes from pending to synced after confirmation. Native Caddy rejection and controlled probe failure preserve the previous live route/revision.

    Unit tests cover coalescing, bounded acknowledgements, transient recovery, idle drift checks, stop during a database read, and draining an in-flight apply. Full local checks and GitHub CI/security workflows passed. All acceptance criteria are covered; production smoke execution in CI remains #13.

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: runtimeenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions