-
Notifications
You must be signed in to change notification settings - Fork 29.1k
-
Notifications
You must be signed in to change notification settings - Fork 29.1k
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
fetch() throws uncatachable UND_ERR_SOCKET exception #54960
Comments
Removed this code from the original example, since it doesn't seem necessary to repro: headers: {
Authorization: 'Bearer ' + API_TOKE
} |
ECONNABORTED errors also seem to be uncatchable and cause the process to exit. Stack trace:
|
I'm unable to reproduce, can you try and make a reproduction (maybe using a loop?): $ for i in {1..100}; do node --no-warnings test.mjs; done
[no output] |
Is it uncaught, or are you logging the error? Since it's wrapped in a 'fetch failed' error it was handled properly in undici. |
It appears to be uncaught. It kills the process whenever it happens. I'm still able to reproduce this, but it appears to only happen under a narrow set of circumstances (perhaps when a PHP script times out, or when a MySQL call within a PHP script times out). I'm working to narrow this down to a more reproducible test case :) |
Interesting. It looks like this only happens when two async tasks are queued up at the same time. This triggers the error: const getNewVocabularyTask = getUpdateVocabularyBody();
const getOldCourseTask = getOldCourse();
const newVocabulary = await getNewVocabularyTask;
const oldCourse = await getOldCourseTask; But this doesn't: const getOldCourseTask = getOldCourse();
const oldCourse = await getOldCourseTask; Still trying to come up with a clean repro. |
Version
v22.8.0
Platform
Subsystem
No response
What steps will reproduce the bug?
While using
fetch()
, I occasionally get this exception:The problem is that the exception is uncatchable. I've already wrapped my
fetch()
called intry/catch
, but when thisUND_ERR_SOCKET
error occurs, it crashes the entire process.How often does it reproduce? Is there a required condition?
Once in every ~100
fetch()
calls.What is the expected behavior? Why is that the expected behavior?
Error should be catch
What do you see instead?
Error is uncatchable and crashes process
Additional information
My code is basically this:
The text was updated successfully, but these errors were encountered: