Skip to content

perf: large session history blocks Gateway after restart - #117108

Merged
steipete merged 1 commit into
mainfrom
codex/skip-large-session-catalog-prewarm
Jul 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/skip-large-session-catalog-prewarm

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where Gateway restart could report ready and then become unresponsive for many minutes while optional session-catalog prewarming synchronously projected a large session store. On the Hetzner recovery host, two consecutive exact-main starts timed out /healthz and RPC while the Gateway consumed a full CPU core for more than eight minutes.

Why This Change Was Made

The earlier sidebar session-list prewarm already materializes each configured agent store. The startup sequence now carries those counts forward and skips only optional catalog prewarming when the combined store exceeds 2,000 entries or when a session-store prewarm failed. Request-time catalog loading remains authoritative, so no catalog capability is disabled.

User Impact

Gateways with unusually large session histories remain responsive after restart instead of blocking health checks and update verification behind cold catalog work. Normal-size stores retain the existing warm-cache behavior.

Evidence

  • Live exact-main reproduction: two consecutive Gateway starts reached the ready log, then /healthz, deep RPC, and verbose health timed out while post-ready.gateway-data.session-catalog.main held roughly one CPU core for more than eight minutes.
  • Blacksmith Testbox tbx_01kyx7zh36v81sq0a9f78gzs36: 6/6 focused startup and session-catalog prewarm tests passed. The regression materializes a 2,001-entry store and requires session-list/plugin prewarming to continue while catalog prewarming is skipped.
  • Autoreview: clean, no accepted/actionable findings.

@steipete steipete self-assigned this Jul 31, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S maintainer Maintainer-authored PR labels Jul 31, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Maintainer decision: approve after current checks.

The exact-head CI gate and Blacksmith changed gate are green at de8e108096464e2a97326c77bab7fe7adbf26168. ClawSweeper's exact-head review artifact reports the patch correct, security cleared, live proof sufficient, and no rank-up moves. Its GitHub comment publisher is still queued, so this records the requested explicit maintainer decision before merge.

@steipete
steipete merged commit 2f875c5 into main Jul 31, 2026
123 of 126 checks passed
@steipete
steipete deleted the codex/skip-large-session-catalog-prewarm branch July 31, 2026 23:44
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant