Skip to content

stream: improving error handling

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
Affected core subsystem(s)

stream

This PR improves error handling for streams in a few ways.

  1. It ensures that no user defined methods (_read, _write, ...) are run after .destroy has been called.
  2. It introduces an explicit error to tell the user if they are write to write, etc to the stream after it has been destroyed.
  3. It makes streams always emit close as the last thing after they have been destroyed
  4. Changes the default _destroy to not gracefully end streams.

Especially 4. makes it easier for userland modules to handle stream errors as they don't appear as graceful closes anymore. Seen issues being with end-of-stream/pump because of this.

Merge request reports

Loading