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

The AppDomain.CurrentDomain.UnhandledException += OnUnhandledException not shows the Stats data in the end #3742

Open
lipingma opened this issue Nov 4, 2024 · 2 comments
Labels
wontfix This will not be worked on

Comments

@lipingma
Copy link

lipingma commented Nov 4, 2024

Bug Report

Symptom

Describe the bug
When the code runs to OnUnhandledException in Instrumentation, it not shows the Stats data in the end.

For process exit, it will show the Stats data in the end like:
[info] Stats: Total time: 8810ms | Total time in Callbacks: 68ms [Initialize=3ms, ModuleLoadFinished=28ms/10, CallTargetRequestRejit=4ms/13, CallTargetRewriter=0ms/0....

Expected behavior
Is this expected not showing Stats data when there is unhandled exception?

Screenshots
If applicable, add screenshots to help explain your problem.

Runtime environment (please complete the following information):

  • OpenTelemetry Automatic Instrumentation version: [e.g. 1.0.0]
  • OS: [e.g. Windows Server 2012 R2 ]
  • .NET version: [e.g. .NET Framework 4.6.2, .NET Core 2.1]

Additional context
Add any other context about the problem here.

Reproduce

Steps to reproduce the behavior:

  1. First step;
  2. Second step;
  3. etc
@nrcventura
Copy link
Member

I do not understand the problem that you are describing in this issue, other than the output in the application stops when an unhandled exception occurs (which causes the process to terminate). Can you tell us more about the application, the configuration that you are using, etc.? Ideally, please provide a Minimal Reproducible Example of the problem.

@RassK
Copy link
Contributor

RassK commented Nov 25, 2024

I guess the context here is about console app?

ASP.NET Core app does not shutdown the runtime in case of unhandled exception. When you exit the process gracefully shutdown stats are still printed.

Unhandled exception in console app does terminate the program so that .NET native profiler does not execute shutdown. If you want to exit gracefully do use Environment.Exit(1); in AppDomain.CurrentDomain.UnhandledException and shutdown stats are printed.

@RassK RassK added the wontfix This will not be worked on label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants