-
Notifications
You must be signed in to change notification settings - Fork 7
fix: remove invalid exn handling #132
fix: remove invalid exn handling #132
Conversation
✅ Deploy Preview for arcus-background-jobs canceled.
|
So, what exactly happens now with removing this code ? The background-job crashes on unhandled exceptions ? |
Well, internally, the CronScheduler uses .NET hosted services, so the service will throw an exception, that's correct. The problem, really, is that we could have an handling logic in our background job, but we do not have access to the service provider or the dependency system. I created an issue here kdcllc/CronScheduler.AspNetCore#47 and provided a solution here kdcllc/CronScheduler.AspNetCore#48 but until now, there's no one responding 😢 . |
Looks like the repo isn't getting that much of attention/commits anyway ... |
Yeah, and I was just looking at their code, seems that in that case the exception is also not logged. Hmm, maybe we should implement our own exception handling strategy and let all our background jobs inherit from that. |
Added some exception handling in the jobs themselves. |
That might be a good idea. |
Already done this in the changes, feel free to take a look. 👍 |
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.
Great.
I am sorry for the delay in including your functionality. I released the latest code todayhttps://github.com/kdcllc/CronScheduler.AspNetCore/pull/50. I hope this helps |
Remove the attempt to log on unobserved exceptions.
We tried to retrieve back the registered logging system, but this is not only wrong, it is rather unstable.
We can either remove this, like in this PR, so that the consumers can see directly what's wrong with their scheduled job (authentication, processing failures...)
Or we can come up with a more resilient scheduled job that logs critical errors for unhandled exceptions in the scheduled job instead on relying on the incomplete 'unobsered exception handling'.
See also kdcllc/CronScheduler.AspNetCore#47 and kdcllc/CronScheduler.AspNetCore#48