nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
107.92k stars 29.74k forks source link

AbortController exception in the wrong place and cannot be caught #55742

Open uriva opened 2 weeks ago

uriva commented 2 weeks ago

Version

23.1.0

What steps will reproduce the bug?

the code in question is https://github.com/webtorrent/bittorrent-tracker/blob/master/lib/client/http-tracker.js#L147

I'm getting the DOMException from the line where the AbortController is created, that is outside the try/catch

How often does it reproduce? Is there a required condition?

Haven't been able to reproduce it locally, happens on a google cloud run instance

What is the expected behavior? Why is that the expected behavior?

The exception should be caught by the try/catch

What do you see instead?

The exception is thrown from an unexpected location.

RedYetiDev commented 2 weeks ago

Can you provide a minimal reproduction?

uriva commented 2 weeks ago

@RedYetiDev I think this is fixed by https://github.com/nodejs/undici/pull/3354 which iiuc is part of unidici 7.0.0

Any idea how I can get this fix in my docker image today? (I don't care which node I'm running)

RedYetiDev commented 2 weeks ago

You can manually use undici? Or build Node.js manually with the upgraded version.

uriva commented 2 weeks ago

Actually I see this still hasn't been fixed. There is an active discussion about fix/WAI/bug that I haven't been able to fully figure out.

geeksilva97 commented 1 week ago

Actually I see this still hasn't been fixed. There is an active discussion about fix/WAI/bug that I haven't been able to fully figure out.

Could you leave a repro on this issue then?

uriva commented 1 week ago

@geeksilva97 I don't have a repro, it happens in production under unknown conditions, but others have experienced the same issue, and the same fix works for everyone. You can see the discussion in the pr I linked above.