async_hooks: execute destroy hooks earlier by Flarna · Pull Request #34342 · nodejs/node

@nodejs-github-bot added the c++

Issues and PRs that require attention from people who are familiar with C++.

label

Jul 13, 2020

addaleax

@Flarna Flarna added the wip

Issues and PRs that are still a work in progress.

label

Jul 13, 2020

bnoordhuis

@Flarna

@Flarna Flarna changed the title async_hooks: execute destroy hooks in interrupt async_hooks: execute destroy hooks faster

Jul 30, 2020

This was referenced

Jul 31, 2020

This was referenced

Aug 1, 2020

@Flarna Flarna changed the title async_hooks: execute destroy hooks faster async_hooks: execute destroy hooks earlier

Aug 2, 2020

Flarna added a commit that referenced this pull request

Aug 2, 2020
Use a microtask to call destroy hooks in case there are a lot queued
as immediate may be scheduled late in case of long running
promise chains.

Queuing a mircrotasks in GC context is not allowed therefore an
interrupt is triggered to do this in JS context as fast as possible.

fixes: #34328
refs: #33896

PR-URL: #34342
Fixes: #34328
Refs: #33896
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>

@Flarna Flarna deleted the asynchooks-destroy-microtask branch

August 2, 2020 21:15

This was referenced

Aug 3, 2020

codebytere pushed a commit that referenced this pull request

Aug 5, 2020
Use a microtask to call destroy hooks in case there are a lot queued
as immediate may be scheduled late in case of long running
promise chains.

Queuing a mircrotasks in GC context is not allowed therefore an
interrupt is triggered to do this in JS context as fast as possible.

fixes: #34328
refs: #33896

PR-URL: #34342
Fixes: #34328
Refs: #33896
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>

This was referenced

Aug 6, 2020

addaleax pushed a commit that referenced this pull request

Sep 22, 2020
Use a microtask to call destroy hooks in case there are a lot queued
as immediate may be scheduled late in case of long running
promise chains.

Queuing a mircrotasks in GC context is not allowed therefore an
interrupt is triggered to do this in JS context as fast as possible.

fixes: #34328
refs: #33896

PR-URL: #34342
Fixes: #34328
Refs: #33896
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>

addaleax pushed a commit that referenced this pull request

Sep 22, 2020
Use a microtask to call destroy hooks in case there are a lot queued
as immediate may be scheduled late in case of long running
promise chains.

Queuing a mircrotasks in GC context is not allowed therefore an
interrupt is triggered to do this in JS context as fast as possible.

fixes: #34328
refs: #33896

PR-URL: #34342
Fixes: #34328
Refs: #33896
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>