1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-21 23:04:45 -05:00

fix: closing / aborting WritableStream is racy (#10982)

This commit is contained in:
Luca Casonato 2021-06-16 02:46:08 +02:00 committed by GitHub
parent d7ce3adc8b
commit ac431ca076
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 14 deletions

View file

@ -2808,7 +2808,7 @@
function writableStreamHasOperationMarkedInFlight(stream) {
if (
stream[_inFlightWriteRequest] === undefined &&
stream[_controller][_inFlightCloseRequest] === undefined
stream[_inFlightCloseRequest] === undefined
) {
return false;
}
@ -2857,11 +2857,11 @@
assert(stream[_storedError] === undefined);
assert(stream[_state] === "writable");
const controller = stream[_controller];
assert(controller);
assert(controller !== undefined);
stream[_state] = "erroring";
stream[_storedError] = reason;
const writer = stream[_writer];
if (writer) {
if (writer !== undefined) {
writableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason);
}
if (

View file

@ -309,11 +309,6 @@
"queuing-strategies.any.html": true,
"readable-byte-streams": {
"bad-buffers-and-views.any.html": [
"ReadableStream with byte source: read()ing from a closed stream still transfers the buffer",
"ReadableStream with byte source: read()ing from a stream with queued chunks still transfers the buffer",
"ReadableStream with byte source: reading into an already-detached buffer rejects",
"ReadableStream with byte source: reading into a zero-length buffer rejects",
"ReadableStream with byte source: reading into a zero-length view on a non-zero-length buffer rejects",
"ReadableStream with byte source: respond() throws if the BYOB request's buffer has been detached (in the readable state)",
"ReadableStream with byte source: respond() throws if the BYOB request's buffer has been detached (in the closed state)",
"ReadableStream with byte source: respondWithNewView() throws if the supplied view's buffer has been detached (in the readable state)",
@ -326,7 +321,12 @@
"ReadableStream with byte source: respondWithNewView() throws if the supplied view is non-zero-length (in the closed state)",
"ReadableStream with byte source: respondWithNewView() throws if the supplied view's buffer has a different length (in the closed state)",
"ReadableStream with byte source: enqueue() throws if the BYOB request's buffer has been detached (in the readable state)",
"ReadableStream with byte source: enqueue() throws if the BYOB request's buffer has been detached (in the closed state)"
"ReadableStream with byte source: enqueue() throws if the BYOB request's buffer has been detached (in the closed state)",
"ReadableStream with byte source: read()ing from a closed stream still transfers the buffer",
"ReadableStream with byte source: read()ing from a stream with queued chunks still transfers the buffer",
"ReadableStream with byte source: reading into an already-detached buffer rejects",
"ReadableStream with byte source: reading into a zero-length buffer rejects",
"ReadableStream with byte source: reading into a zero-length view on a non-zero-length buffer rejects"
],
"construct-byob-request.any.html": false,
"general.any.html": [
@ -424,16 +424,16 @@
"properties.any.html": true,
"reentrant-strategies.any.html": true,
"strategies.any.html": true,
"terminate.any.html": [
"controller.terminate() inside flush() should not prevent writer.close() from succeeding"
]
"terminate.any.html": true
},
"writable-streams": {
"aborting.any.html": false,
"aborting.any.html": true,
"bad-strategies.any.html": true,
"bad-underlying-sinks.any.html": true,
"byte-length-queuing-strategy.any.html": true,
"close.any.html": false,
"close.any.html": [
"when close is called on a WritableStream in waiting state, ready should be fulfilled immediately even if close takes a long time"
],
"constructor.any.html": true,
"count-queuing-strategy.any.html": true,
"error.any.html": true,