Skip to content

Commit 64c38cd

Browse files
committed
chore(execution): remove verbose comments from isolated-vm changes
1 parent 33bf94a commit 64c38cd

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

apps/sim/lib/execution/isolated-vm-worker.cjs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,6 @@ async function executeCode(request) {
142142
stdoutTruncated = true
143143
}
144144

145-
// Hoist all ivm handle declarations so finally can release them deterministically.
146-
// Per isolated-vm upstream issues #198 and #377: child handles (scripts, callbacks,
147-
// references, external copies) must be released before isolate.dispose() to avoid
148-
// stuck-GC states and native memory leaks outside the V8 heap.
149145
let context = null
150146
let bootstrapScript = null
151147
let userScript = null
@@ -376,10 +372,6 @@ async function executeCode(request) {
376372
},
377373
}
378374
} finally {
379-
// Release child handles first (scripts, callbacks, references, external copies),
380-
// then dispose the isolate. Order matters: disposing the isolate while child
381-
// handles still exist can cause stuck-GC states (isolated-vm issue #198).
382-
// .release() is idempotent — safe to call even if the object was never assigned.
383375
const releaseables = [
384376
userScript,
385377
bootstrapScript,

apps/sim/lib/execution/isolated-vm.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -727,9 +727,7 @@ function spawnWorker(): Promise<WorkerInfo> {
727727

728728
import('node:child_process')
729729
.then(({ spawn }) => {
730-
// isolated-vm v6 requires --no-node-snapshot on Node.js 20+.
731-
// Without it, Node's shared V8 snapshot heap is incompatible with isolated-vm
732-
// and causes SIGSEGV on worker startup (isolated-vm issue #377).
730+
// Required for isolated-vm on Node.js 20+ (issue #377)
733731
const proc = spawn('node', ['--no-node-snapshot', workerPath], {
734732
stdio: ['ignore', 'pipe', 'pipe', 'ipc'],
735733
serialization: 'json',
@@ -839,10 +837,6 @@ async function acquireWorker(): Promise<WorkerInfo | null> {
839837
const existing = selectWorker()
840838
if (existing) return existing
841839

842-
// Count only non-retiring workers toward pool occupancy so that a replacement
843-
// can be spawned pre-emptively while a retiring worker is still draining its
844-
// in-flight executions. Retiring workers stay in `workers` until they drain,
845-
// but they no longer accept new work, so they shouldn't block new spawns.
846840
const activeWorkerCount = [...workers.values()].filter((w) => !w.retiring).length
847841
const currentPoolSize = activeWorkerCount + spawnInProgress
848842
if (currentPoolSize < POOL_SIZE) {

0 commit comments

Comments
 (0)