-
Notifications
You must be signed in to change notification settings - Fork 9.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
[Feature]: Fix Leaking async ops in Deno #11839
Comments
@guillaume86 I am not familiar with deno but it would great to get things running there. Does it make sense to address the issue in the |
Hi, thanks for answering. Yes I'm aware of the headers option in puppeteer, unfortunately Deno do not look like it will implement them as it's going against the Web spec: denoland/deno#7632 . As for fixing the ws package for Deno it's probably above my skill level (and the amount of time I'm willing to invest in this tbh). I'm afraid an issue there will not get any traction since for most use cases the standard Deno class is enough. I'm not sure what are the use cases for custom headers in puppeteer, if it's nothing major, a deno specific entrypoint with a warning that custom headers are not supported would be nice. Otherwise a webSocketFactory option seem like the minimum changes option, let users worry about supporting custom headers or not. |
they have a websocketstream api that supports headers |
There seems to have been an upstream fix for this, which landed with Deno v1.46.3, I will close this now, but if the issue is still there please commend and I will reopen it. |
Feature description
Running on Deno with a npm: import is almost perfect but there's still some issues:
Warning: Not implemented: ClientRequest.options.createConnection
which doesn't seem to break functionnality.You can expose these issues with a simple test file:
save as ´main_test.ts´ and run it with
deno test -A --trace-ops
, you will see this:The async leaks are the source of the 30s delay on close.
The issues seem to originate from the
ws
dependency, because just monkey patching NodeWebSocketTransport to use the standard Deno WebSocket client seem to fix both issues:I'm not sure it matters but the deno WebSocket class do not allow options (headers, etc), in my testing it didn't seem to impact functionality.
Would you consider adding a deno entrypoint in your project which would substitute the ws WebSocket with the globalThis one (something like https://github.com/yargs/yargs/blob/main/deno.ts) ? Or maybe just a
setWebSocketFactory(...)
so we can cleanly replace the WebSocket class.The text was updated successfully, but these errors were encountered: