Repository navigation
Conversation
Copilot-Session: c3579153-958b-482e-bd14-025a1a9c09af
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.
Problem
The benchmark wraps the MinIO client to count S3 bytes. On reads,
countS3Opsreturnedstream.pipe(counting)..pipe()doesn't pass source errors on to the destination. If the S3 store reset a connection partway through a response body (ECONNRESET), the source stream died but thecountingTransform was never ended or errored. yhub'sfor awaitinS3PersistenceV1.retrievethen waited forever and never reached its retry for transient errors.Seen in Y2.5 (300 clients joining a 20 MB doc at 100 conn/s, local MinIO): 60-100 joins never received syncStep2, so the benchmark hung. All 600 GETs received headers but only ~498 bodies finished, and no error was reported. A standalone script without the wrapper saw the same resets surface as ordinary ECONNRESET errors.
Fix
Count bytes in an async generator that passes each chunk through, wrapped with
Readable.from:A read error on the source now throws out of the generator and into the caller's
for await, so yhub's existing retry runs. If the caller stops reading early, the source stream is destroyed and its socket released (it wasn't with.pipe()).Testing
npx standard benchmarks/src/andnpx tsc --skipLibCheckpass.countS3Opsagainst a local HTTP server:BENCH_DEBUG=1): all three rates completed with no hang. MinIO reset 185 GETs mid-body; each surfaced as ECONNRESET and hit yhub's retry. 139 retries also failed, which exactly matches the dropped-client count (0 / 27 / 112), so every drop is a failed retry rather than a hang.Only the benchmark harness changes; yhub itself is untouched.