refactor(js): centralize runtime session handling - #7449
Conversation
Move the shared goja execution lifecycle out of the pooled and non-pooled paths into a common session helper. Per-path hooks now handle setup, callback registration, interrupt waiting, cleanup, runtime return, and slot release, while abandon handling stays centralized. Abandoned runtimes are no longer touched or reused until their orphaned goroutine exits. Closes #7417 Signed-off-by: Dwi Siswanto <git@dw1.io>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThis PR refactors the JavaScript runtime lifecycle by introducing a session abstraction that centralizes ownership of runtime setup, execution, interruption, cleanup, and slot management. Both pooled and non-pooled execution paths now delegate to the session rather than handling these concerns separately. ChangesRuntime Session Lifecycle Refactoring
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)Command failed Comment |
Proposed changes
Move the shared goja execution lifecycle out of
the pooled and non-pooled paths into a common
session helper.
Per-path hooks now handle setup, callback
registration, interrupt waiting, cleanup, runtime
return, and slot release, while abandon handling
stays centralized. Abandoned runtimes are no
longer touched or reused until their orphaned
goroutine exits.
Closes #7417
Proof
Checklist
Summary by CodeRabbit
Tests
Bug Fixes