Repository navigation
[release/11.0.1xx] Fix AndroidMessageHandler upload I/O exception translation - #13157
Merged
jonathanpeppers merged 1 commit intoOct 15, 2026
Merged
Conversation
Fixes #12934's upload exception-contract failure. The TLS performance concern remains separate; measurements are attached to the issue. This PR makes no TLS or default-handler changes. `OutputStreamInvoker` wraps Java transport failures in managed `IOException`, bypassing the handler's Java-only exception translation. Translate managed I/O failures during request-body copying using the existing compatibility helper. Cancellation handling runs first, the original exception chain is retained, seekable streams are rewound, and unrelated application exceptions remain unchanged. Adds repeated loopback upload-reset coverage for both completion options, asserting the exception chain, uncancelled caller token, and rewind. Also tests content-source I/O/non-I/O failures and enables focused execution of existing connection/redirect tests. ### Validation Release, physical Samsung SM-A165F, API 36, arm64. Current checkout targets `net11.0-android` but pins runtime `12.0.0-alpha.1.26509.101`; the reporter's exact .NET 11 RC package and x86_64/Mono/NativeAOT configurations were not tested. - `make prepare CONFIGURATION=Release && make all CONFIGURATION=Release` — preparation passed; initial build failed on missing extra API reference assemblies. - `./dotnet-local.sh build Microsoft.Android.slnx -c Release -t:BuildExtraApiLevels -v:q` — passed; subsequent `make all CONFIGURATION=Release` passed. - `./dotnet-local.sh build -t:ConfigureLocalWorkload -c Release build-tools/create-packs/Microsoft.Android.Sdk.proj -v:q` — passed. - Final `make all CONFIGURATION=Release` — passed, 0 warnings/errors. - `git diff --check` — passed. Final install — passed, 0 errors, 38 existing analysis/trimming warnings: ```sh ANDROID_SERIAL=R58Y30HZ65V ./dotnet-local.sh build -t:Install -c Release \ -p:RuntimeIdentifier=android-arm64 '-p:AdbTarget=-s R58Y30HZ65V' \ '-p:IncludeCategories=AndroidMessageHandlerExceptions%3BAndroidMessageHandlerCancellation' \ tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj -v:q ``` Final device run — **16 passed, 0 failed, 0 skipped**: ```sh (cd tests/Mono.Android-Tests/Mono.Android-Tests && \ ANDROID_SERIAL=R58Y30HZ65V ../../../dotnet-local.sh test Mono.Android.NET-Tests.csproj \ --no-build -c Release -p:RuntimeIdentifier=android-arm64 \ '-p:IncludeCategories=AndroidMessageHandlerExceptions%3BAndroidMessageHandlerCancellation' \ --device R58Y30HZ65V --report-trx \ --results-directory ../../../bin/TestRelease/TestResults) ``` Before/after proof: temporarily removing only the production catch, rebuilding, and running the upload category produced 3 failures in 4 cases: both resets and source `IOException` failed; unrelated application-exception propagation passed. Restoring the catch and rebuilding produced the passing final run. NUnit counts each three-repeat reset as one case.
github-actions
Bot
requested review from
jonathanpeppers and
simonrozsival
as code owners
October 15, 2026 13:46
jonathanpeppers
approved these changes
Oct 15, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Backport of #13125 to release/11.0.1xx
/cc @jonathanpeppers @simonrozsival