Skip to content

fix(runtime-host): defer Graph wakes while Session execution is paused - #4992

Open
99Gaoxiaoqi wants to merge 1 commit into
apache:mainfrom
99Gaoxiaoqi:fix/defer-paused-graph-wakes
Open

fix(runtime-host): defer Graph wakes while Session execution is paused#4992
99Gaoxiaoqi wants to merge 1 commit into
apache:mainfrom
99Gaoxiaoqi:fix/defer-paused-graph-wakes

Conversation

@99Gaoxiaoqi

Copy link
Copy Markdown
Contributor

Summary

Fixes #4991

A recovered Graph checkpoint could exhaust three background admission attempts while its Session was in Plan mode or lacked an explicit connection identity, then drain the whole Host during startup. Preserve pending/retryable wakes while admission is paused and resume them after explicit account binding or execution resume.

Recovery waits for existing wake tasks and any foreground Plan turn, then rechecks the checkpoint before delivery. Plan cancellation, receipt replay, unrelated model changes, archive and Graph stop retain their existing semantics. Other execution errors retain the existing failure handling.

Verification

  • Root npm run build, npm run lint, npm run format:check, npm run typecheck, and both required knip workspace checks passed.
  • Nine affected storage/runtime/runtime-host suites: 205 tests passed, none failed or skipped. Covers persisted pending wakes, admission races, explicit account binding, ordinary Plan approval, foreground Plan execution, replay, stop and archive.
  • Four new production-composition recovery cases fail against unpatched f4abd4918 (attemptCount 3 instead of 1) and pass with this fix. Reproduction commands and results.
  • Credential-free production HostKernel A/B: baseline startup fails after three Plan admission attempts; this fix opens the same database, stays ready and adds zero attempts. Neither run constructs a model backend. Historical user-data copies independently reproduced the missing-account case; no private data is attached.
  • ASF source headers, protocol epoch guard and git diff --check passed. Full repository npm test and Windows/Linux execution were not run locally; this changes no UI, wire format or database schema.

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex performed diagnosis, implementation, regression tests, local validation, and prepared/submitted this PR at the human contributor's request. The commit includes Generated-by: OpenAI Codex. Final human review and merge remain with the contributor and maintainers.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

Preserve durable checkpoints during Plan mode or missing connection identity, then resume after explicit configuration or Plan execution changes. Keep foreground Plan admission ahead of background recovery.

Fixes apache#4991

Generated-by: OpenAI Codex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XL Under 2500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(runtime-host): paused Graph recovery retries admission and fails Host startup

1 participant