-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Promise.timeout() leaks a promise reference after resolution/rejection #371
Comments
Man that turn around time. Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since timeout() uses window.setTimeout() but does not clearTimeout() on resolution/rejection, a handle to the promise (and its resolution data) is leaked in the window for the duration of the timeout, even if the request is rapidly resolved. When the rate of data transfer is very high, this causes the browser to OOM and crash within minutes.
We use promises in the context of requests that have a vastly variable range of latency and transfer speed (between milliseconds and tens of minutes) due to unpredictable network/operational conditions. Promise.timeout() can handle this with a sufficiently large timeout setting, but this causes problems under very low latency conditions.
The text was updated successfully, but these errors were encountered: