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
Errors from writeAlgorithm does not release the lock at all per the spec, as returning a rejected promise is not enough, which leads to a permanent lock as there's no GC-triggered lock release either.
The FS spec probably can get some algorithm to return a promise that waits for the lock release and use it for each exception, but that's sad as the implementations should do extra care for every implementation-specific error conditions. Could be nice if the Streams spec had some async hook to handle the error.
Afaict when the writeAlgorithm rejects, WritableStreamDefaultControllerProcessWrite (https://streams.spec.whatwg.org/#writable-stream-default-controller-process-write) calls WritableStreamFinishInFlightWriteWithError which calls WritableStreamDealWithRejection, which calls WritableStreamFinishErroring, which ends up calling the abort algorithm?
Afaict when the writeAlgorithm rejects, WritableStreamDefaultControllerProcessWrite (https://streams.spec.whatwg.org/#writable-stream-default-controller-process-write) calls WritableStreamFinishInFlightWriteWithError which calls WritableStreamDealWithRejection, which calls WritableStreamFinishErroring, which ends up calling the abort algorithm?
Step 8 of FinishErroring returns early when there's no pending abort request, so not always.
What is the issue with the File System Standard?
https://fs.spec.whatwg.org/#write-a-chunk throws when getting a non-FileSystemWriteChunkType:
But the spec does not say whether this exception should release the lock. In fact, the release only happens within:
Errors from writeAlgorithm does not release the lock at all per the spec, as returning a rejected promise is not enough, which leads to a permanent lock as there's no GC-triggered lock release either.
The FS spec probably can get some algorithm to return a promise that waits for the lock release and use it for each exception, but that's sad as the implementations should do extra care for every implementation-specific error conditions. Could be nice if the Streams spec had some async hook to handle the error.
cc @jjjalkanen
cc @domenic @MattiasBuelens
The text was updated successfully, but these errors were encountered: