Skip to content

stream: regression in v14, this.push(null) in Transform doesn't emit end #35926

Description

@rlidwka
  • Version: v14.5.0
  • Platform: Ubuntu/Linux
  • Subsystem: stream
let stream = require('stream');

let src = new stream.Readable({
  read() {
    console.log('push')
    this.push(Buffer.alloc(20000));
  }
});

let dst = new stream.Transform({
  transform(chunk, output, fn) {
    this.push(null);
    fn();
  }
});

src.pipe(dst);

function parser_end(error) {
  console.log('parser ended', error);
  dst.removeAllListeners();
}

dst.once('data', data => console.log(data));
dst.once('end', () => parser_end());
dst.on('error', error => parser_end(error));
  • Expected behavior (tested on node v10, 12): end event is emitted by dst, transform stops, source pauses.
  • Actual behavior (tested on node v14): end event does not get emitted by dst, transform runs indefinitely.

Activity

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

    confirmed-bugIssues and PRs for confirmed bugs.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