Skip to content

stream: don't deadlock on aborted stream

Not all streams (e.g. http.ClientRequest) will always emit 'close' after 'aborted'.

Noticed this while fixing some stuff in fastify. I think the root issue will be fixed by https://github.com/nodejs/node/pull/27984. But I still think it's a good idea to have this fix/workaround in the npm stream-readable package for older node versions.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading