Skip to content

[POC] Prototype language-initiated Workflow cache eviction - #2399

Draft
mjameswh wants to merge 1 commit into
mainfrom
codex/lang-initiated-cache-eviction-poc
Draft

[POC] Prototype language-initiated Workflow cache eviction#2399
mjameswh wants to merge 1 commit into
mainfrom
codex/lang-initiated-cache-eviction-poc

Conversation

@mjameswh

@mjameswh mjameswh commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add maxWorkflowThreadHeapMiB and proactively evict least-recently-used idle Workflows under per-thread heap pressure
  • expose Core's language-requested Workflow eviction through the bridge
  • retain tombstones for locally disposed Workflows and send typed failed activation completions when activations race with local state loss
  • replace failed or out-of-memory Workflow threads and request Core eviction for every Workflow they owned
  • retain ordinary failed Workflow state until Core eviction, matching Retain failed Workflows until Core eviction #2378
  • treat cleanup failure as fatal or replace the affected thread

Core dependency

Depends on temporalio/sdk-rust#1592 for the replay-state regression and clarified eviction contract. This branch points the sdk-core submodule at commit 5c958888d017225f4f8108f1b4eeafa519ff2009.

Testing

  • TypeScript builds for @temporalio/worker and the test package
  • 111 focused lifecycle, options, heap-policy, and Workflow tests
  • changed-file ESLint
  • Core targeted regression, lint, and formatting checks

@mjameswh mjameswh changed the title Prototype language-initiated Workflow cache eviction [POC] Prototype language-initiated Workflow cache eviction Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant