Skip to content

Commit 5445ba3

Browse files
committed
stamp: raise termination flag when supervising ends
1 parent 2fbf0e4 commit 5445ba3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crates/base/src/rt_worker/worker_ctx.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ pub fn create_supervisor(
141141

142142
// we assert supervisor is only run for user workers
143143
let conf = worker_runtime.conf.as_user_worker().unwrap().clone();
144+
let is_termination_requested = worker_runtime.is_termination_requested.clone();
144145
let cancel = cancel.clone();
145146

146147
worker_runtime.js_runtime.add_near_heap_limit_callback(move |cur, _| {
@@ -207,6 +208,8 @@ pub fn create_supervisor(
207208
cancel.notify_waiters();
208209
}
209210

211+
is_termination_requested.raise();
212+
210213
// NOTE: If we issue a hard CPU time limit, It's OK because it is
211214
// still possible the worker's context is in the v8 event loop. The
212215
// interrupt callback would be invoked from the V8 engine

0 commit comments

Comments
 (0)