Skip to content
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

Addition of concurrent "running set" alternative to "count" #14

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

clockhart7
Copy link

The purpose of this code change is to handle concurrency job count not being decremented after a resque worker dirty exit. This causes restricted concurrent jobs to remain enqueued indefinitely since the code thinks there are jobs being worked on while there actually are not.

Rather than using a running count, a set of jobs is kept, with jobs being added and removed upon start and finish. Each time a job is attempted to be enqueued, a check is done to cross reference the jobs currently being worked on by each worker and the jobs in the running set. Any jobs that are in the running set but not actually being worked on are removed, allowing the restricted check to be done based on the correct number.

The gem still will default to the count configuration so this will not affect current users. To change to the new set configuration, the class accessor "tracking_type" must be set to "set" in the configuration step. Note, the set configuration of the gem will only work when the job args are unique for each job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants