-
Notifications
You must be signed in to change notification settings - Fork 132
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
Deadlock when using batches #141
Comments
Is this still a problem here? Since you closed it on the Hangfire project itself? |
It still is an issue. I closed it on the Hangfire project itself because the issue itself is not a "problem" with the Hangfire project. Currently Hangfire pro is only supported on SqlServer and Redis.pro. I had some contact with Sergey and he told me that it's the way locking works in de Hangfire.Postgresql that is causing deadlocks. But it will not be an easy task to change this i think. On the other side you have the question how many people would use it, since afaict nobody is using Hangfire.postgresql with hangfire.pro batches (i could be very wrong here..). Sergey also told me that he is considering contributing to postgresql/mysql but he currently doesn't know when so you don't want to give any promises. |
How does it need to be changed according to Sergey then? |
Quoting Sergey
Second mail
|
Moving to locks like these: https://www.postgresql.org/docs/current/explicit-locking.html#ADVISORY-LOCKS wouldn't be that hard I guess. AFAIK that will require PostgreSQL 9.0 and upwards.. But I don't know if that's a good move. |
I'm don't know either, i don't know which versions people are running this on. But besides that there were some earlier comments why advisory locks shouldn't be used here #82 This is from a few years back i can't really tell if this is still relevant. |
Yeah. The current locks are cross server. Advisory locks are not. But it could be an option if you're running just one hangfire server. |
Hi, any news on this? |
Is this still the case with 1.9.3 |
Yes and no, I will explaim But becuase the exception we cannot be sure that the code is working so bottom line I think its not working The exception is:
|
Hangfire.Core: v1.7.8
Hangfire.PostgreSql: v1.6.3
Hangfire.Pro: v2.2.1
Dotnet Core: v2.2
Possible deadlock in the postgresql storage connector.
I don't see anything when using Trace logging for Hangfire.I think there is something wrong with the locking but don't know how to debug this. To test this i made a empty project with just hangfire and those 2 jobs.
The first enqueue is enqueued by BackgroundJob:
The StartCache job then inserts a batch job:
The Batchjob is inserted en the jobs are enqueued. It says they are fetched but nothing happens:
On the batches page it says that it's processing 1 job but nothing is happening:
Let me know if you require any information or have some pointers on how to find what the issue is here.
The text was updated successfully, but these errors were encountered: