Skip to content

Since v20.13.0 fetch() ing small files without reading their body delays process termination for 8 seconds #52909

Open
@unilynx

Description

@unilynx

Version

v20.13.0

Platform

Linux 33f5daf61896 6.4.16-linuxkit #1 SMP PREEMPT Thu Nov 16 10:49:20 UTC 2023 aarch64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

docker run --rm -ti node:20.13.0 /bin/bash

 cat > test.js
async function main() {
  const x = await fetch ('http://cms6-sites.webhare.com/test-arnold/empty.docx');
  console.log(x);
}
main()

^D

node test.js

The node process will not terminate after downloading the document

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

100%

What is the expected behavior? Why is that the expected behavior?

Process should terminate

What do you see instead?

Process does not terminate

Additional information

  • downgrading to 20.12.2 fixes the issue
  • the reported uname above is on a Mac M3 with Linux inside docker, but I can reproduce it on native x86_64 linux hosts too
  • it does not fail when the document is served under a different mimetype (eg try with http://cms6-sites.webhare.com/test-arnold/empty.docx)
  • it also hangs when the URL is changed to https
  • I can also reproduce it with other docx files

Edit: fixed version number where it still works, there is no 20.12.3, oops.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fetchIssues and PRs related to the Fetch APIv20.xv20.x Issues that can be reproduced on v20.x or PRs targeting the v20.x-staging branch.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions