Skip to content

the main thread doesn't wait for AbortSignal #46417

Description

@dhcmrlchtdj

Version

v19.5.0

Platform

Darwin MacBookAir.local 22.3.0 Darwin Kernel Version 22.3.0: Thu Jan 5 20:49:43 PST 2023; root:xnu-8792.81.2~2/RELEASE_ARM64_T8103 arm64

Subsystem

No response

What steps will reproduce the bug?

$ node -e 'setTimeout(() => console.log("setTimeout"), 1000)'
setTimeout

$ node -e 'AbortSignal.timeout(1000).addEventListener("abort", () => console.log("AbortSignal"))'
$ # no output

$ node -e 'setTimeout(() => console.log("setTimeout"), 1100); AbortSignal.timeout(1000).addEventListener("abort", () => console.log("AbortSignal"))'
AbortSignal
setTimeout

the node process will wait for setTimeout, but not for AbortSignal.

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

node process should wait for AbortSignal and log AbortSignal after 1000ms.

What do you see instead?

the node process returns immediately, the AbortSignal.timeout is ignored.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    abortcontrollerIssues and PRs related to the AbortController API

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions