镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

stream: read after destroy? #29477

Description

@ronag

Reading the Readable.read implementation it is a bit unclear to me what happens and what should happen when this method is called after destroy().

Should it be an error (e.g. READ_AFTER_DESTROY) or a noop?

Activity

  1. addaleax commented on Sep 7, 2019

    @addaleax
    Member

    I think both behaviours are okay, so I’d go with the variant that is less breaking, i.e. making it a noop.

  2. added
    streamIssues and PRs related to Node.js streams.
    on Sep 7, 2019
  3. ronag commented on Sep 8, 2019

    @ronag
    MemberAuthor

    @addaleax: I've done a quick fix for the most problematic parts #29491.

    However, there seems to be an assumption that readable streams will still work with buffered data after destroy(), i.e. 'end' (and 'finish' for that matter) is expected to be emitted after destroy() in several tests.

    I started on a "proper" fix but it quickly hit several tests #29485.

    Thoughts? @mcollina

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    streamIssues and PRs related to Node.js streams.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions