Skip to content

Fixed issues with async event handlers and improved trace logging #306

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

Merged
merged 2 commits into from
May 9, 2023

Conversation

niemyjski
Copy link
Member

@niemyjski niemyjski commented May 9, 2023

Found a case where process exit and unhandled event handlers will return early due to being marked async causing early exit. This could potentially (unlikely) cause a dead lock on shutdown due to GetAwaiter().GetResult() but benefits greatly outweigh (I was also unable to cause this scenario with a deadlock)

Also, we may want to consider having our internal trace loggers implement disposable so flush is called (may be happing today by ioc but flush and dispose is not called by default)

I also greatly improved logging of the client to give more visibility of what is happening instead of only logging on error:

2023-05-09 08:01:44.3824 Info  ExceptionlessClient: Startup called ApiKey=MY_API_KEY ServerUrl=https://localhost:5000
2023-05-09 08:01:44.5095 Info  ExceptionlessClient: Startup finished
2023-05-09 08:01:49.7881 Info  ExceptionlessClient: ProcessExit called
2023-05-09 08:01:49.7884 Info  ExceptionlessClient: Processing event queue
2023-05-09 08:01:49.7888 Info  ExceptionlessClient: Sending Session End Heartbeat
2023-05-09 08:01:49.8143 Info  DefaultEventQueue: Sent 1 events to "https://localhost:5000".
2023-05-09 08:01:50.0305 Info  ExceptionlessClient: ProcessExit finished

@niemyjski niemyjski added the bug label May 9, 2023
@niemyjski niemyjski requested a review from ejsmith May 9, 2023 13:03
@niemyjski niemyjski self-assigned this May 9, 2023
@niemyjski niemyjski merged commit 61e3291 into main May 9, 2023
@niemyjski niemyjski deleted the bug/shutdown-issue-and-improved-loggging branch May 9, 2023 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants