-
Notifications
You must be signed in to change notification settings - Fork 292
Problem with Error [ERR_MULTIPLE_CALLBACK]: Callback called multiple times after 16.4.2 -> 16.8.0 upgrade #3516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
Looked into this some more.. Here's a simple testcase
In 16.8.0. this fails with
In 16.4.2 the error is not raised
In 16.4.2 the callback code generated by node streams pipeline is
Where as in 16.8.0 it is
So the code attached by pipeline has clearly changed. The questions are
|
Closing as a duplicate of nodejs/node#39923 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I have code that ran without errors in 16.4.2 which now fails in 16.8
The code is failing with
'
Error [ERR_MULTIPLE_CALLBACK]: Callback called multiple times
at NodeError (node:internal/errors:371:5)
at onFinish (node:internal/streams/writable:667:37)
at processTicksAndRejections (node:internal/process/task_queues:82:21) {
code: 'ERR_MULTIPLE_CALLBACK'
}
2021-08-27T00:50:56.485Z [INFO][PIPELINE][STREAM WRITER][character_types][Postgres][Y
This appears to be caused by the fact that the following code has been added to the standard on finish callback
function onFinish(err) {
if (called) {
errorOrDestroy(stream, err ?? ERR_MULTIPLE_CALLBACK());
return;
}
called = true;
I fully understand that my code should probably have never worked in the first place, but how can I trace where the callback is being invoked so I can work out how it's being called twice....
The text was updated successfully, but these errors were encountered: