-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Jobs Stuck in Enqueued State #2355
Comments
Thanks for the dump file! I believe the following thread is the most interesting one. It holds a semaphore, so other worker threads are waiting on its completion. And if this thread stuck, then new background jobs will not be processed. And it is likely it's stuck. I found the following issue on GitHub - dotnet/runtime#70656 - with a similar stack trace happened in .NET 6.X and that issue states the issue was fixed in .NET 7.0. I see you are using an affected version, so perhaps the best recommendation I can give is to upgrade to a newer .NET version. Unfortunately, I also see dotnet/runtime#83455, but looks like it was fixed in .NET 7.0.7 and 8.0.
|
@odinserj, thank you so much for getting back to me on this so quickly!! I have upgraded to .NET 8 just now and am about to deploy to see how it goes!! 🤞 |
It did not go well. Here is the stack trace from when it happened again: ASP.NET Core .NET 8 |
That is, I assume, the symptom of the underlying issue. When this happens, the system thinks those jobs are still running and won’t enqueue them again. So in the instance from the screen shot, we now have 63 unique recurring jobs that never get enqueued again. The only way I can find to get them running again is to stop the app pool, drop all hangfire.* collections from mongo, and then start the app pool again. (we add the recurring jobs on startup) |
In this case, I might be causing you to go in a wrong direction with that method and .NET upgrade, sorry for this. I think it's better to raise an issue in the Hangfire.Mongo repository and describe the situation, because counters and actual contents should be consistent with each other. |
I am using Hangfire.Mongo and the owner said that he's found a bug in Hangfire.Mongo and he's pretty sure the same would happen with Sql Storage, too. gottscj/Hangfire.Mongo#380 (comment) |
I realize I'm not using the latest versions of things but these were the latest versions when I started having this issue in production. But due to stdump issue IndexOutOfRangeException - What am I doing wrong? I could not get a stack trace dump when I had the latest version of the packages.
ASP.NET Core .NET 6
Hangfire.AspNetCore" Version="1.8.6"
Hangfire.Console" Version="1.4.2"
Hangfire.Core" Version="1.8.6"
Hangfire.Dashboard.BasicAuthorization" Version="1.0.2"
Hangfire.Mongo" Version="1.9.12"
stdump_hangfire.txt
Classes have this attribute applied: SkipWhenPreviousJobIsRunningAttribute.txt
Execute Methods have
[DisableConcurrentExecution("{0}", 3)]
appliedThe text was updated successfully, but these errors were encountered: