Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/8.0] [android][ios] Fix dispose problem with NativeHttpHandlers (#93262) #93291

Merged

Conversation

steveisok
Copy link
Member

@steveisok steveisok commented Oct 10, 2023

Backport of #93262 to release/8.0

/cc @steveisok

Fixes #93252

Customer Impact

#93252 identified a regression in HttpClientHandler on mobile where repeat requests would prematurely dispose the underlying native http handler. This leads to calling Dispose more than once and the runtime will throw Cannot access a disposed object and terminate the requests.

The fix was to avoid disposing of the underlying native handler prematurely.

Testing

Tested a patched SDK locally against a MAUI app that made multiple requests.

Risk

Low

)

dotnet#90298 made sure the MetricsHandler was the top level handler for all NativeHttpHandler requests similar to what is done with SocketsHttpHandler. After creating the MetricsHandler, the code mistakenly disposed of `_nativeHandler`, which resulted in `Dispose` being called multiple times and eventually throwing a `Cannot access a disposed object` exception.

Fixes dotnet#93252
@ghost ghost assigned steveisok Oct 10, 2023
@steveisok steveisok added Servicing-consider Issue for next servicing release review and removed area-System.Net.Http labels Oct 10, 2023
@ghost
Copy link

ghost commented Oct 10, 2023

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #93262 to release/8.0

/cc @steveisok

Customer Impact

Testing

Risk

Low

Author: steveisok
Assignees: steveisok
Labels:

area-System.Net.Http

Milestone: -

@steveisok steveisok changed the title [android][ios] Fix dispose problem with NativeHttpHandlers (#93262) [release/8.0] [android][ios] Fix dispose problem with NativeHttpHandlers (#93262) Oct 10, 2023
@ghost
Copy link

ghost commented Oct 10, 2023

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #93262 to release/8.0

/cc @steveisok

Customer Impact

#93252 identified a regression in HttpClientHandler on mobile where repeat requests would prematurely dispose the underlying native http handler. This leads to calling Dispose more than once and the runtime will throw Cannot access a disposed object and terminate the requests.

The fix was to avoid disposing of the underlying native handler prematurely.

Testing

Tested a patched SDK locally against a MAUI app that made multiple requests.

Risk

Low

Author: steveisok
Assignees: steveisok
Labels:

Servicing-consider, area-System.Net.Http

Milestone: -

@steveisok steveisok added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Oct 10, 2023
@karelz karelz added this to the 8.0.0 milestone Oct 11, 2023
@carlossanlop carlossanlop merged commit b886d5a into dotnet:release/8.0 Oct 12, 2023
110 of 117 checks passed
@ghost ghost locked as resolved and limited conversation to collaborators Nov 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net.Http Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants