HangfireIO / HangfireIO/Hangfire

Sql DeadLocks

Open
#2,406 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
10.1k
Forks
1.8k
Avg merge
1h 19m
Merged PRs (30d)
1

Description

Im currently running scheme 9, I'm seeing a lot of xp_userlock and (@id bigint)select InvocationData, StateName, Arguments, CreatedAt from [HangFire].Job with (readcommittedlock, forceseek) where Id = @id select Name, Value from [HangFire].JobParameter with (forceseek) where JobId = @id

that are taking a long time to complete and creating deadlock. I'm only try to process about 300 jobs at the moment.

This is my current setup.

![image](https://github.com/HangfireIO/Hangfire/assets/104718532/92ae634d-12a1-4df3-a14d-70adb4a73e8f)

![image](https://github.com/HangfireIO/Hangfire/assets/104718532/4d9e8089-029d-424e-b423-eb0480e5fc70)

![image](https://github.com/HangfireIO/Hangfire/assets/104718532/7c4f7b91-21af-49f2-af8b-4c2b522386ea)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the report using schema 9 and the shown setup, while capturing SQL Server deadlock information for the xp_userlock activity. Inspect the Job and JobParameter queries and compare their locking behavior while processing about 300 jobs. Done means the cause is identified and the reported long-running queries no longer create deadlocks under the same workload.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, sql
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.