HangfireIO / HangfireIO/Hangfire

Throttling Breaks when Deleting Processing Jobs

Open
#1,971 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
10.1k
Forks
1.8k
Avg merge
1h 19m
Merged PRs (30d)
1

Description

I recently found an issue where jobs go straight to scheduled after using the delete feature on the dashboard. The job in question is using a [semaphore ](https://docs.hangfire.io/en/latest/background-processing/throttling.html#semaphores) to limit concurrent execution to 5 at a time. After deleting 5 jobs that were in the processing state all new jobs go straight to the scheduled state. I looked at the hangfire redis db and found what appears to be the semaphore for my job and once removing the 5 entries shown in the attached photo jobs began processing again. It appears deleting a processing job does not properly release the semaphore.

![semaphore](https://user-images.githubusercontent.com/10885165/142294125-65485651-ae75-4f70-ac67-1e4c6ea2b48a.png)

Contributor guide

Open the contributing guide

Research direction

Start with the dashboard flow for deleting processing jobs and inspect how the semaphore state is stored in the Redis database. Reproduce the case by deleting five semaphore-limited processing jobs, then verify that the permits are released and subsequent jobs leave the scheduled state and process normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, redis
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.