Re: [whatwg/streams] pipeTo() algorithm shuts down too early on readable close()? (#644)

> It sounds like the problem is in "Shutdown must stop all activity". We want any reads to always be followed by writes... as long as the dest is "writable", I guess. Shutdown says "Wait until any ongoing write finishes" already, but if the write isn't ongoing yet that doesn't work.

I will try to come up with some wording for this.

For the Chromium implementation, I'm thinking of removing the 'Wait until any ongoing write finishes (i.e. the corresponding promises settle).' step from 'shutdown with action' because now that we treat underlying sink write() as uninterruptible it doesn't make any difference any more, and that step is troublesome to implement. Maybe we should also remove it from the standard?

> I think this works with the current spec:
> 
> close() ends up in "Closing must be propagated forward"
> We go to "shutdown with an action" of WritableStreamDefaultWriterCloseWithErrorPropagation(writer).
> We wait for any ongoing writes to finish. One errors, causing dest.[[storedError]] to be set.
> We let p be the result of performing WritableStreamDefaultWriterCloseWithErrorPropagation(writer).
> p is rejected with dest.[[storedError]].
> We finalize with dest.[[storedError]].

I see. I will write a test for this, after checking that it isn't already covered.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/644#issuecomment-272769089

Received on Monday, 16 January 2017 04:00:53 UTC