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

Heroku / dokku and "ValueError: There's already an active RQ scheduler" #93

Closed
darkpixel opened this issue Aug 18, 2015 · 4 comments
Closed

Comments

@darkpixel
Copy link

I'm running dokku, which is a "Docker powered mini-Heroku in around 100 lines of Bash".

I switched to RQ a few weeks ago after celery kept locking up workers due to a deep multi-threading issue in python. RQ is working perfectly except for one small issue...

When I 'git push' my code up to my server, dokku creates a new container with the updated code, then it starts all the services in the NEW container, makes sure they are running, switches traffic to the new container, then shuts down the old container.

The only problem is that rq-scheduler checks to see if there is an active instance of the scheduler running. Unfortunately there is--in the old container that is about to get killed.

In my case, I don't care if the about-to-die-scheduler queues up a bunch of jobs in an instant before the new scheduler comes up and queues the same jobs up.

Would a command-line flag to ignore an already running scheduler, be useful?

Another option might be to allow multiple schedulers to run, but only the one that holds the lock can submit new tasks. If it dies, and the lock expires, another scheduler could grab it and start submitting...

I'd be willing to try my hand at writing a patch if you approve of either idea.

@jmmills
Copy link

jmmills commented Aug 18, 2015

Related issues: #62 and #70

On Aug 17, 2015, at 9:56 PM, Aaron C. de Bruyn notifications@github.com wrote:

I'm running dokku, which is a "Docker powered mini-Heroku in around 100 lines of Bash".

I switched to RQ a few weeks ago after celery kept locking up workers due to a deep multi-threading issue in python. RQ is working perfectly except for one small issue...

When I 'git push' my code up to my server, dokku creates a new container with the updated code, then it starts all the services in the NEW container, makes sure they are running, switches traffic to the new container, then shuts down the old container.

The only problem is that rq-scheduler checks to see if there is an active instance of the scheduler running. Unfortunately there is--in the old container that is about to get killed.

In my case, I don't care if the about-to-die-scheduler queues up a bunch of jobs in an instant before the new scheduler comes up and queues the same jobs up.

Would a command-line flag to ignore an already running scheduler, be useful?

Another option might be to allow multiple schedulers to run, but only the one that holds the lock can submit new tasks. If it dies, and the lock expires, another scheduler could grab it and start submitting...

I'd be willing to try my hand at writing a patch if you approve of either idea.


Reply to this email directly or view it on GitHub.

@selwin
Copy link
Collaborator

selwin commented Aug 19, 2015

I like this idea, please see my comment here: #70 (comment)

@Fajkowsky
Copy link

Any suggestions how to fix that?

@isuruperera97
Copy link

remove all keys in redis if your in development

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

No branches or pull requests

5 participants