What has changed in response.body.cancel()
between node 20 and 21?
#3208
-
I have an integration test for a server streaming HTTP responses. This integration test worked fine on node 20 but failed on node 21 and 22. const reader = response.body.getReader()
try {
/* read some chunks */
}
finally {
reader.releaseLock()
await response.body.cancel()
} At the end of the tests, With node 21 and 22 I had to call In the end I changed all the tests to use const response = await fetch(iri, {
dispatcher: new Agent({ bodyTimeout: 1000 }),
}); This also ensures that all the connections close and that While this might be enough for my tests, I still would like to understand why the connections appear to stay open after |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Could you prepare a complete example to reproduce? I have a feeling on why but I would need to investigate. |
Beta Was this translation helpful? Give feedback.
I have a feeling we added a bug somewhat earlier that it was then fixed. I've added a test for this exact case, so we know we won't regress anymore: #3219.
You can expect the version of undici in 22.1.0 to reach 20 in the next quarter.