-
Notifications
You must be signed in to change notification settings - Fork 164
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
us.abort() is not called if us.write() fails #620
Comments
I think we should also resolve the same question for |
I realized that there is a somewhat analogous situation for readable streams actually :-/. E.g. in https://streams.spec.whatwg.org/#example-rs-pull, if |
My severity analysis: Naively written sources and sinks will tend to leak resources. Some number of hours will be lost to debugging these resource leaks. Garbage collection will mitigate this issue for some Javascript-authored streams, but not all. For example, a WebSocket will stay alive as long as it is open and a message handler exists, so GC would not clean them up. My usability analysis: If My proposal: Do nothing now. Discuss adding |
The proposal sounds good. However I wonder if we should also remove the fallback from abort to close, to maintain the idea that the "v1" feature set is focused around obvious mappings, and not around convenient cleanup---especially convenient cleanup that only works in one of the many cases. Also we should fix up all the examples to do proper cleanup. |
+1 for removal of the fallback |
1 similar comment
+1 for removal of the fallback |
See discussion in #620 and in particular the conclusion at #620 (comment).
See discussion in #620 and in particular the conclusion at #620 (comment).
See discussion in #620 and in particular the conclusion at #620 (comment).
Currently an exception or rejection from
us.write()
will not result inus.abort()
being called. If the underlying sink wants to free resources, it has to do it before returning the error. Something like this:If
us.abort()
(with fallback tous.close()
) was called automatically, then this would become a lot simpler.The text was updated successfully, but these errors were encountered: