Menu ▾ ▴

#131 deploy: gate asset self-heal on staleness (skip cp/redis/clear-cache when manifest already current) + timeout

closed
nobody
None
2026-07-01
2026-07-01
Anonymous
No

Originally created by: grynn-in

Fast-follow to [#125] (both reviewers flagged, non-blocking).

refresh-assets.sh now runs from the backend web entrypoint on every start — it unconditionally cps the baked assets.json, evicts the Redis assets_json key, and runs bench clear-cache (which boots a full Frappe/DB context). That cost is paid on every docker compose restart, crash-loop cycle, and scale event — even when the manifest is already correct.

Asks:

  1. Staleness guard — compare the baked assets.json hash/mtime to the live sites/assets/assets.json and skip the heal when identical. This also fixes the dev hot-patch clobber (Opus L2): a docker cp konsol + bench build + restart writes newer konsol hashes into the volume manifest, which the current unconditional copy reverts on the next restart → freshly-built assets 404. A staleness/newer check would leave a genuinely-newer manifest alone.
  2. timeout 15 bench ... clear-cache — bound wall-clock so a hung clear-cache (DB lock) can't wedge gunicorn start (currently only guarded against non-zero exit, not hangs).
  3. Nit: mkdir -p sites/assets before the primary cp (RTL copy is guarded, primary isn't).

Non-blocking; the current behavior is bounded + || true-wrapped + healthcheck-tolerant.

Related

Tickets: #125
Tickets: #134

Discussion

  • Anonymous

    Anonymous - 2026-07-01

    Originally posted by: grynn-in

    📋 Decision brief (options + trade-offs + recommendation): docs/developer-guide/decisions/konsolidat-131-selfheal-staleness.md — merged in [#133].

     

    Related

    Tickets: #133

  • Anonymous

    Anonymous - 2026-07-01

    Ticket changed by: grynn-in

    • status: open --> closed
     

Log in to post a comment.