diff --git a/src/node_platform.cc b/src/node_platform.cc index a5e20ce5bd7136..56529bc3a79c4a 100644 --- a/src/node_platform.cc +++ b/src/node_platform.cc @@ -462,6 +462,8 @@ void NodePlatform::DrainTasks(Isolate* isolate) { std::shared_ptr per_isolate = ForNodeIsolate(isolate); if (!per_isolate) return; + // Worker tasks aren't associated with an Isolate. + worker_thread_task_runner_->BlockingDrain(); // Drain foreground tasks but not worker tasks as this may cause deadlocks // and v8::Isolate::Dispose will join V8's worker tasks for that isolate. while (per_isolate->FlushForegroundTasksInternal()) {