Skip to content

[DNS] Ignore ObjectDisposedException on CancellationToken Callback#115765

Merged
liveans merged 4 commits into
dotnet:mainfrom
liveans:fix_dns_ode
May 20, 2025
Merged

[DNS] Ignore ObjectDisposedException on CancellationToken Callback#115765
liveans merged 4 commits into
dotnet:mainfrom
liveans:fix_dns_ode

Conversation

@liveans

@liveans liveans commented May 20, 2025

Copy link
Copy Markdown
Member

Reported by 2 customers.

Previously, there was a lock on this codepath, but it has been removed since .NET 7.0, deleted in #63904 to handle different issue

Copilot AI review requested due to automatic review settings May 20, 2025 07:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies the cancellation registration logic for DNS resolution to ignore ObjectDisposedException, addressing reported issues from two customers.

  • Added a catch block for ObjectDisposedException in RegisterForCancellation.
  • Updated commentary to clarify that the handle is already released and the exception can be safely ignored.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

…olutionPal.Windows.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>

@rzikm rzikm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with a nit.

@liveans

liveans commented May 20, 2025

Copy link
Copy Markdown
Member Author

/azp run runtime-libraries-coreclr outerloop-windows

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@liveans

liveans commented May 20, 2025

Copy link
Copy Markdown
Member Author

Outerloop failures are unrelated

@liveans liveans enabled auto-merge (squash) May 20, 2025 16:20
@liveans

liveans commented May 20, 2025

Copy link
Copy Markdown
Member Author

/ba-g Failures unrelated

@liveans liveans merged commit 87143d9 into dotnet:main May 20, 2025
@liveans

liveans commented May 21, 2025

Copy link
Copy Markdown
Member Author

/backport to release/9.0-staging

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/9.0-staging: https://github.com/dotnet/runtime/actions/runs/15165475339

@liveans

liveans commented May 21, 2025

Copy link
Copy Markdown
Member Author

/backport to release/8.0-staging

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/15165504525

SimaTian pushed a commit that referenced this pull request May 27, 2025
…115765)

* Ignore ObjectDisposedException on CancellationToken Callback

* Update src/libraries/System.Net.NameResolution/src/System/Net/NameResolutionPal.Windows.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>

* Change wording in comment

---------

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants