I'm using FluentScheduler 3.1.42, which appears to not support async jobs.
We have a few tasks that execute async code by using .Wait(). They work well and have never caused a task to hang, despite all await statements not using ConfigureAwait(false).
I added a new task that's a bit more complicated that does multiple awaits and uses WhenAll with the SemaphoreSlim pattern. This task usually works, but occasionally hangs (only twice in about a week, and it's scheduled to run every 5 seconds on 2 servers) until I restart the web server.
So my question is: could the periodic hangs be caused by not calling configureAwait(false) on all await statements down the pipe? If so, why doesn't it hang everytime? If not, any idea what might be causing my task to hang?
UPDATE
I updated my code to dispose the semaphore slim and also an smtp object that was being used, and that seemed to have cleared up the issue. I did also add explicit calls to configureAwait for good measure and wrapped fewer awaits in the semaphore try/finally since I didn't need to limit concurrency for as much code as I had been. Not totally sure what was exactly was happening, but it doesn't seem to be happening anymore, so that's cool.