Repository navigation
fix(streaming): settle responses when the callback executor rejects work - #416
Closed
sylvesterkaczmarek wants to merge 1 commit into
Closed
sylvesterkaczmarek wants to merge 1 commit into
sylvesterkaczmarek wants to merge 1 commit into
Conversation
Contributor
|
Closing along with #415. The reasoning is in #415 (comment). |
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.
Summary
Fixes #415.
Observe the completion of the streaming callback stage, so a rejected executor settles
onCompleteFuture()exceptionally and closes the unread response. Previously, the ignored dependent future held the rejection while the public completion future remained pending and the response stayed open.Use executor-independent cleanup, following the existing AutoPagerAsync pattern. Preserve the original transport failure if its bookkeeping races with rejection, and do not replace an earlier explicit close. User callbacks are never moved onto a fallback thread.
Validation
Four new tests cover a shutdown default executor before/after response completion, a rejecting per-subscription executor, earlier transport failures, explicit close, exactly-once resource release and ordinary delivery on a real worker thread.
git diff --checkpassed.Tested with OpenJDK 21 on macOS arm64. Validation used one Gradle worker, in-process Kotlin compilation and a 10 GiB heap through local command-line flags. No build configuration changes.
The complete repository suite, Java 8 runtime, live API calls and other operating systems were not tested. When an executor refuses work, callbacks cannot run there; callers receive the failure through the completion future and the response is released. No public interfaces, dependencies or existing test expectations change.
Based on main at
6324b459fcde08738a255adcd88439b68851d512.