You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The author is trying to be diligent in closing the handle whatever happens. But since #721 if writer.abort() is called and then sink.write() fails, cleanup() will be called twice.
My feeling is that while this is unfortunate, the principle that sink.abort() is always called if writer.abort() is called before any other errors on the stream is a good one. I think adding finally() (#636) in V2 will provide a better way to implement the above sink, and until then we don't need to take any action.
I opened this issue to gather other opinions and to track this problem.
The text was updated successfully, but these errors were encountered:
I agree with your feeling. I think in general without finally(), double-cleanup or not-enough-cleanup is a hazard with the current API, and you need to write code resilient to that. I guess we should prioritize finally() a decent bit.
I've been having second thoughts about this. But I really want to provide a stable target in the medium-term for browsers to implement. We could probably keep tweaking things forever if we let ourselves.
If/when browser vendors start complaining about this behaviour, that would be a good time to change it.
This was raised by @tyoshino in web-platform-tests/wpt#5421 (comment)
Consider the following sink:
The author is trying to be diligent in closing the handle whatever happens. But since #721 if writer.abort() is called and then sink.write() fails, cleanup() will be called twice.
My feeling is that while this is unfortunate, the principle that sink.abort() is always called if writer.abort() is called before any other errors on the stream is a good one. I think adding finally() (#636) in V2 will provide a better way to implement the above sink, and until then we don't need to take any action.
I opened this issue to gather other opinions and to track this problem.
The text was updated successfully, but these errors were encountered: