Skip to content

Conversation

@marianstefi20
Copy link

Suppose the scheduler receives a SIGKILL. If this happens between zrem and zadd in enqueue_job() the repeatable or cron jobs might stop working properly altogether. This is because the job is first consumed from Redis and later added in the sorted set with a score that's the future time at which it will run.

To solve this, I propose using a transaction in enqueue_job. This would assure the atomicity of the sequence of operations.

pipe.execute()
return

next_scheduled_time = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain the rationale behind changing the way which next_scheduled_time calculation is different than the current implementation?

@selwin
Copy link
Contributor

selwin commented Apr 24, 2020

Sorry for the late reply, I'd like to get this merged in if you could just address my comment here: #223 (comment)

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.

2 participants