Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: discard remaining foreground tasks on platform shutdown #29587

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/node_platform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,13 @@ void PerIsolatePlatformData::Shutdown() {
if (flush_tasks_ == nullptr)
return;

CHECK_NULL(foreground_delayed_tasks_.Pop());
CHECK_NULL(foreground_tasks_.Pop());
// While there should be no V8 tasks in the queues at this point, it is
// possible that Node.js-internal tasks from e.g. the inspector are still
// lying around. We clear these queues and ignore the return value,
// effectively deleting the tasks instead of running them.
foreground_delayed_tasks_.PopAll();
foreground_tasks_.PopAll();

CancelPendingDelayedTasks();

ShutdownCbList* copy = new ShutdownCbList(std::move(shutdown_callbacks_));
Expand Down