Repository navigation
Conversation
This branch has not been deployed
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.
Closes #2280. Includes #2284, which fixes #2279.
Java SSE collectors can remain blocked while awaiting headers or an idle response body. Both Java streaming flows can lose chunks when their channels fill, and
linescan stall cancellation while awaiting body data.Share response ownership through a private helper: run blocking requests interruptibly on the IO dispatcher, close the body exactly once on completion, failure or cancellation, and deliver chunks with suspending
send. Preserve pending body ownership when cancellation races with response arrival. Callback cancellation reaches the collector, decoder failure stops further processing, and closing a cancelled body cannot replace cancellation with an I/O error. Retainlines' declared response charset and blank-line behaviour.This SSE lifetime fix is already included in Kroog and is working in production applications using Kroog. Original implementations by mrkim: d5ca5f6b2 and 1f64cf724. This patch adapts the SSE implementation into a shared helper and extends equivalent handling to
lines. The lines extension and cancellation-race guard have local regression evidence; they are additional changes beyond the deployed Kroog SSE source.The JDK body lifecycle contract and coroutine send contract establish the expected resource ownership and delivery behaviour.
Twenty focused tests cover local HTTP servers, controlled response arrival, body closure, cancellation, failure, lossless delivery, bounded decoding and declared charset handling. Baseline red runs demonstrate sixteen failing regression cases and three passing compatibility controls; the charset control is additional validation.
This branch is stacked on the separately reviewed SSE framing commit
62fd7298b54d7aa883564b4845c407625e6f1e7b. It can merge with that ancestor intact, or merge #2284 first and rebase the transport change ontodevelop. The transport diff adds no public symbols or dependencies. No non-JVM targets are involved.Validation: all 61 module JVM tests pass, including the twenty added tests and seven framing tests. Module
ktlintCheck,jarandgeneratePomFileForMavenPublicationpass. The compiled JVM ABI exactly matches the checked-in dump. Target:develop.