What steps will reproduce the bug?
I had a ERR_INTERNAL_ASSERTION when trying to run our application using node 15.x, for a stream destroy test. This code is the minimal version to reproduce it.
The code works ok on node 14.16.1, but fails under node 15.14.0
'use strict';const{pipeline: pipelineCb, Writable, Readable}=require('stream');constutil=require('util');constpipeline=util.promisify(pipelineCb);(async()=>{// Create a dummy readable streamleti=0;constreadable=newReadable({objectMode: true,read(){this.push({counter: i++});}});// Create a dummy writable stream with backpressureconstwritable=newWritable({objectMode: true,write: (chunk,encoding,callback)=>{setTimeout(callback,10);// Backpressure}});// Pipeline the sql stream in the dummy writable stream & destroy the writable stream after a few mstry{awaitPromise.all([pipeline(readable,writable),(async()=>{// Destroy the stream after a few element// pipeline will destroy all the streamsawaitnewPromise(resolve=>setTimeout(resolve,50));writable.destroy();})()]);}catch(e){if(e.code!=='ERR_STREAM_PREMATURE_CLOSE'){throwe;}}})().catch(e=>{console.error(e);process.exitCode=1;});To reproduce (under node 15):
% node index.js
node:internal/assert:14
throw new ERR_INTERNAL_ASSERTION(message);
^
Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues
at new NodeError (node:internal/errors:329:5)
at assert (node:internal/assert:14:11)
at Writable.destroy (node:internal/streams/writable:851:5)
at Object.destroyer (node:internal/streams/destroy:365:59)
at node:internal/streams/pipeline:73:17
at finish (node:internal/streams/pipeline:159:23)
at node:internal/util:408:5
at node:internal/streams/pipeline:74:5
at finish (node:internal/streams/pipeline:159:23)
at node:internal/util:408:5 {
code: 'ERR_INTERNAL_ASSERTION'
}
Expected behavior (under node14):
% node index.js
<no output>
What steps will reproduce the bug?
I had a ERR_INTERNAL_ASSERTION when trying to run our application using node 15.x, for a stream destroy test. This code is the minimal version to reproduce it.
The code works ok on node 14.16.1, but fails under node 15.14.0
To reproduce (under node 15):
Expected behavior (under node14):