-
Notifications
You must be signed in to change notification settings - Fork 296
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
Prevent UnobservedTaskException in LeaderElector #1420
Conversation
Welcome @klesta490! |
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## master #1420 +/- ##
=========================================
Coverage ? 70.35%
=========================================
Files ? 89
Lines ? 2648
Branches ? 0
=========================================
Hits ? 1863
Misses ? 785
Partials ? 0 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
you mean ex in |
Well consequently. Exception is thrown from This is unobserved exception we experienced
|
not covered by ? |
No it is not covered as you can see from my PR. Or am I missing something? Who observes exception from |
i mean there is a catch in renew loop (line 75) the idea is give user a change to catch ex when calling to |
Yes, I am talking about AcquireAsync. Point of my PR is to prevent this UnobservedTaskException because there is nothing in client code (my app) that I can do to avoid it. |
could you paste your example code how you use the leader election? |
Anyway, I don't see how is this relevant, have you looked at my commit? I don't want to be rude, but are you familiar with https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.taskscheduler.unobservedtaskexception?view=net-7.0 ? |
sorry, i am new to c# |
i wonder why didnt the catch all work |
Here |
ah i see, could you please add the ex to OnError? |
Sure, done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/LGTM
thanks for pr of the edge case
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: klesta490, tg123 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@klesta490 please sign cla |
/LGTM |
Thanks |
We have noticed that LeaderElector can produce UnobservedTaskException, this PR aims to 'observe' this exception so UnobservedTaskException handler is not invoked.