Skip to content

Cron downtime regardless of setup? #800

@latisaron

Description

@latisaron

Hi there, I have been met with a situation where using when resque-scheduler, downtime is unavoidable.

To give more context:

  1. resque-scheduler-version: 4.7.0 (don't judge me please)
  2. resque.rake:
# boilerplate
Resque.schedule = YAML.load_file('config/dummy_schedule.yml')
# boilerplate
  1. dummy_schedule.yml
random_job:
  cron: "* * * * *"
  queue: generic
  custom_job_class: "ResqueRandomJob"
  description: "Runs every minute

On a multi-scheduler setup, where I reach a situation when I have:

  • 1 master
  • 1 child

If the master somehow dies, there are a few seconds (based on the lock-acquiring time) where the jobs do not run at all. I tested this by killing the process kill -9 pid at XX:XX:58, the next run being at XX:XX+1:00. This means that the child must become master, but in that situation, it might take a variable amount of time, based on where in the interval the child is, to become master again.

Therefore, in that one specific minute, there will be a missed enqueued job.

I was wondering if I'm doing anything wrong in this setup;

I also have an idea for a solution, but first I would like if I'm making any mistakes in this setup.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions