Conversation
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
Closing a connection while a channel delivery coroutine is awaiting a window-update write can complete that write with a
TransportExceptionrather thanCancellationException.ForwardingChannel.incomingDeliveryJoband the session delivery workers let that exception escape theirlaunchcoroutine. On Android, the uncaught exception can terminate the app during otherwise normal disconnect/reconnect.A nested transport can also throw from
close()when it tries to sendCHANNEL_CLOSEthrough an already disconnected gateway. That exception currently escapescloseTransport()and interrupts the remaining teardown.This was reproduced with cbssh 0.5.0 by repeatedly connecting through an SSH gateway, executing
printf connected, and closing the route. The command succeeds, but asynchronous teardown can fail afterward. A JVM reproducer that captures uncaught background exceptions also fails without the patch. The affected code is unchanged on currentmain.Changes
The public API is unchanged.
Validation
./gradlew buildpassed on a branch based on upstreamd2e2936: 1,280 library tests passed, 6 skipped; 11 protocol tests passed. Formatting and Metalava compatibility checks passed. Gradle reused the previously passing test results for identical inputs.Local build note: supplied the Mockito public key already trusted by upstream verification metadata because its keyserver lookup was unavailable. Signature verification stayed enabled; no keyring or verification metadata changes are included in this PR.