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

Reliable queues #43

Closed
wants to merge 3 commits into from
Closed

Reliable queues #43

wants to merge 3 commits into from

Conversation

danieldk
Copy link
Contributor

This branch implements durable/reliable queues. Queues are polled with the atomic RPOPLPUSH command to store the job on an in-flight list. If the job was completed through termination, it is requeued. Otherwise it is just removed from the in-flight list.

An additional process can be used to requeue jobs in the case a worker was terminated improperly (e.g. via a SIGKILL).

Queues are polled with the atomic RPOPLPUSH command to store the job on an
in-flight list. If the job was completed through termination, it is
requeued. Otherwise it is just removed from the in-flight list.

An additional process can be used to requeue jobs in the case a worker
was terminated improperly (e.g. via a SIGKILL).
If end(false) is called on the job executor, the job that is currently
running is allowed to finish. Consequently, we should not requeue a job
in that case.
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 0c63ec2 on danieldk:reliable-queues into ffabf16 on gresrun:master.

@gresrun
Copy link
Owner

gresrun commented Feb 28, 2014

@danieldk After looking through this I do have one concern, compatibility with Resque and others. Since this pull-request essentially reverses the direction the queues are used, I'm not sure we will be compatible anymore. Do you have any thoughts on this?

@danieldk
Copy link
Contributor Author

danieldk commented Mar 1, 2014

I agree. It's a shame that Redis doesn't have lpoprpush, lpoplpush, etc.
But if we use my lpoprpush implementation for popping of the queue as well,
we could keep the queue in Resque-order. Once Redis adds that command (I
think it's scheduled for 3.0 now), it can be switched to the native command.

Do you think that'll better? If so, I'll make a new, rebased pull request
with this change.

On Sat, Mar 1, 2014 at 12:26 AM, Greg Haines notifications@github.comwrote:

@danieldk https://github.com/danieldk After looking through this I do
have one concern, compatibility with Resque and others. Since this
pull-request essentially reverses the direction the queues are used, I'm
not sure we will be compatible anymore. Do you have any thoughts on this?


Reply to this email directly or view it on GitHubhttps://github.com//pull/43#issuecomment-36405338
.

@gresrun
Copy link
Owner

gresrun commented Mar 1, 2014

Yes, I like that idea. Maintaining compatibility is important.

I look forward to a native lpoprpush. I see the Redis issue and gave it a +1 but I'm not sure it has much traction, unfortunately.

@danieldk
Copy link
Contributor Author

danieldk commented Mar 3, 2014

This ticket is superseded by #44.

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

Successfully merging this pull request may close these issues.

3 participants