We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b887942 commit 1bc4970Copy full SHA for 1bc4970
src/node_platform.cc
@@ -462,10 +462,9 @@ void NodePlatform::DrainTasks(Isolate* isolate) {
462
std::shared_ptr<PerIsolatePlatformData> per_isolate = ForNodeIsolate(isolate);
463
if (!per_isolate) return;
464
465
- do {
466
- // Worker tasks aren't associated with an Isolate.
467
- worker_thread_task_runner_->BlockingDrain();
468
- } while (per_isolate->FlushForegroundTasksInternal());
+ // 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());
469
}
470
471
bool PerIsolatePlatformData::FlushForegroundTasksInternal() {
0 commit comments