Skip to content
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

Closed
henryptung opened this issue Oct 30, 2014 · 1 comment
Closed

Comments

@henryptung
Copy link

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.

@nomcopter
Copy link

Man that turn around time. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants