-
Notifications
You must be signed in to change notification settings - Fork 565
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
Default fetch timeout too short #1373
Comments
@ronag Would it make sense to change default request timeout undici-wide to 120 seconds (presumably like in Node.js) or 300 seconds (like in Chrome)? |
What's the current timeout? |
30 seconds |
Sure thing, let's bring it at least to 120 to match Node.js. |
Now that #1386 was merged, should this be closed? |
The default time out is only 30 seconds again? I don't see 5 minutes anymore set in |
I would suggest we bump the undici defaults then... |
The problem is that we're using undici fetch bundled with Node.js. Is there even a way to override this in such case? Setting to Chrome default 5 minutes would be great. In the mean time, can we use
|
You can make Node.js fetch use a custom dispatcher with: globalThis[Symbol.for('undici.globalDispatcher.1')] = dispatcher; |
@targos I'm sorry, that's above my level of knowledge. So how would I override the bodyTimeout with custom dispatcher and fetch bundled with Node.js? |
I'm also interested in learning how to override the
inspired by @targos ' suggestion above, and
but none seemed to have any effect. I need a timeout longer than 300s but used 10s here just for testing. In both cases |
This is really frustrating. For now I'm "patching" all of my occurrences of import { fetch } from 'undici' wherever I run requests that might validly take longer than 30 seconds to resolve. |
This is becoming an issue with AI requests. |
By default fetch times out after 30 seconds. This causes issues like #1248
Chrome has 300 second time out.
Please set default unidici fetch timeout to 300 seconds by default.
The text was updated successfully, but these errors were encountered: