-
Notifications
You must be signed in to change notification settings - Fork 512
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
(regression?) timeouts while reading a body no longer abort with a TimeoutError #3296
Comments
Tested with latest main without success: const { fetch: undiciFetch } = require('undici')
async function test (method) {
const signal = AbortSignal.timeout(1000)
const res = await method(
'https://httpbin.org/drip?duration=2&numbytes=10&code=200&delay=0',
{ signal }
)
await res.arrayBuffer()
}
test(undiciFetch).then(
() => {
console.log('undicifetch: done')
},
err => console.log('undicifetch:', err)
)
test(fetch).then(
() => {
console.log('fetch: done')
},
err => console.log('fetch:', err)
) Outcome: undicifetch: DOMException [TimeoutError]: The operation was aborted due to timeout
at new DOMException (node:internal/per_context/domexception:53:5)
at Timeout._onTimeout (node:internal/abort_controller:130:9)
at listOnTimeout (node:internal/timers:573:17)
at process.processTimers (node:internal/timers:514:7)
fetch: DOMException [TimeoutError]: The operation was aborted due to timeout
at new DOMException (node:internal/per_context/domexception:53:5)
at Timeout._onTimeout (node:internal/abort_controller:130:9)
at listOnTimeout (node:internal/timers:573:17)
at process.processTimers (node:internal/timers:514:7) |
@metcoder95 what you posted would be the intended outcome. You're not logging if it was a header or body timeout. header timeouts appeared to throw a TimeoutError in my tests. but today I can't replicate it any longer. Neither with undici 6.16.0 nor any later version... According to the stacktrace the error is thrown here It throws there when error is falsy. I'll try to figure out how that can happen |
Bug Description
I'm not sure when this changed, but undici no longer throws a TimeoutError when reading the body
Reproducible By
Expected Behavior
Both calls should abort with a
TimeoutError
Logs & Screenshots
Environment
node v20.12.2
undici 6.16.0
Additional context
The text was updated successfully, but these errors were encountered: