Repository navigation
fix: released writer surface and failed compression close (#193, #223) - #229
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 43 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
- A released WritableStreamDefaultWriter throws workerd's released TypeError from desiredSize in every state, and releaseLock installs a fresh rejected ready (a pre-release read keeps the old settlement) while closed keeps its own once settled. - DecompressionStream/CompressionStream writables behave as workerd's internal streams after a failed push or flush: the writable side closes, so later write()/close() report the closed-stream TypeError, desiredSize is 0, abort() resolves, writer.closed rejects with the failure and writer.ready resolves. - The gate gains writer-released and decompression-close-after-error; crates/cello/tests/stream_edges_conformance.rs pins both, verified failing on 209791e.
- The two stream cases from this change are in the total.
ryuzdev
force-pushed
the
fix/workerd-diff-stream-edges
branch
from
November 23, 2026 20:09
d45ccdd to
bc4cc02
Compare
This was referenced Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two more workerd divergences from the differential gate, both measured on
workerd 1.20261121.1.
#193 — a released
WritableStreamDefaultWriterdesiredSizenow throwsTypeError: This WritableStream writer has been released.in every stream state. It used to report the stream's size, andnullonce the stream had errored.releaseLock()installs a fresh rejectedready, as workerd does: a readafter the release is the released error, while a handler attached before the
release keeps the old settlement (still resolved, or still the stream's
error). Previously a released writer on an errored stream kept carrying that
error from
ready.closedkeeps its own settlement once it has one and still rejects with thereleased error while pending;
write(),close(),abort()and a secondreleaseLock()are unchanged and already matched.readycaptured before the releasedoes not reproduce on 209791e: both runtimes resolved it. The actual
readydivergence is the post-release read, pinned here.
#223 —
DecompressionStreamclose after a failed writeWorkerd's compression streams are internal streams, so a failed push or flush
closes the writable side instead of erroring it:
close()/write()thenreport
TypeError: This WritableStream has been closed.(cello replayed thestored
Decompression failed.),desiredSizeis 0 andabort()resolves,while
writer.closedrejects with the failure andwriter.readyresolves.compression_streams.jsopts its transform-stream writable into that settle;a plain
TransformStreamstill errors both sides.CompressionStreamsharesthe path and is pinned by the same case.
Tests
writer-releasedanddecompression-close-after-error; the fullgate agrees 193/193 on the rebased base.
crates/cello/tests/stream_edges_conformance.rsasserts the measured valuesin-isolate. Verified failing on 209791e (four
desiredSizestates plus theerrored-stream post-release
ready; the compressionclose/write/desiredSize), passing with the fix.--all-targets -D warnings,fmt --checkandcheck-docspass locally; the gate and the two tests were re-run afterrebasing onto bf0b177 (brotli boxing).
Out of scope, measured while probing and left for their own issues:
workerd's truncated-gzip close message (
Called close() on a decompression stream with incomplete datavs cello'sDecompression failed.),CompressionStreamaccepting a string chunk (workerd UTF-8-encodes it), andworkerd's failed compression writable staying locked after
releaseLock().