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

[Breaking change]: SystemEvents.EventsThreadShutdown Obsolete with SYSLIB0059 #43563

Open
1 of 3 tasks
lonitra opened this issue Nov 13, 2024 · 1 comment
Open
1 of 3 tasks
Assignees
Labels
breaking-change Indicates a .NET Core breaking change doc-idea Indicates issues that are suggestions for new topics [org][type][category] Pri1 High priority, do before Pri2 and Pri3 ⌚ Not Triaged Not triaged

Comments

@lonitra
Copy link
Member

lonitra commented Nov 13, 2024

Description

After https://github.com/dotnet/runtime/pull/108489/files SystemEvents.EventsThreadShutdown callbacks will no longer be called before the process exits. It is marked as obsolete with SYSLIB0059

Version

.NET 10 Preview 1

Previous behavior

SystemEvents.EventsThreadShutdown callbacks would be called before the process exits.

New behavior

SystemEvents.EventsThreadShutdown callbacks are no longer called before the process exits.

Type of breaking change

  • Binary incompatible: Existing binaries might encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
  • Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code might require source changes to compile successfully.
  • Behavioral change: Existing binaries might behave differently at run time.

Reason for change

SystemEvents' previous shutdown handling could block the finalizer thread during app shutdown. To avoid blocking finalizer thread, SystemEvents no longer has shutdown handling consequentially meaning that SystemEvents.EventsThreadShutdown is no longer called.

Recommended action

Recommendation is if users had been using this is to hook to AppDomain.ProcessExit instead.

Feature area

Core .NET libraries

Affected APIs

SystemEvents.EventsThreadShutdown

@lonitra lonitra added breaking-change Indicates a .NET Core breaking change doc-idea Indicates issues that are suggestions for new topics [org][type][category] Pri1 High priority, do before Pri2 and Pri3 labels Nov 13, 2024
@dotnetrepoman dotnetrepoman bot added the ⌚ Not Triaged Not triaged label Nov 13, 2024
@gewarren
Copy link
Contributor

I think this is "source compatible" since there's a new warning if you recompile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Indicates a .NET Core breaking change doc-idea Indicates issues that are suggestions for new topics [org][type][category] Pri1 High priority, do before Pri2 and Pri3 ⌚ Not Triaged Not triaged
Projects
Status: 🔖 Ready
Development

No branches or pull requests

2 participants