Skip to content

Conversation

Matthew-Kilpatrick
Copy link

The existing behaviour auto-released the lock once the schedule:runcommand finished execution.

For short running tasks (~1 second or less), auto-releasing the lock can lead to a case where if a cron starts slightly later on another server, the lock from the first invocation has already been deleted, and the task is executed for a second time. For a cluster of 3 app servers running in the same datacenter using Redis to store locks, I've noticed this happening fairly frequenty on ~1 second jobs (~30% of the time).

This change relies on the DEFAULT_TTL constant to tidy-up locks rather than doing so in this extension. I'm not entirely sure this is the best way of handling things, so I'm open to other ideas!

The existing behaviour auto-released the lock once
the `schedule:run`command finished execution.

For short running tasks (~1 second or less), auto-releasing the lock can
lead to a case where if a cron starts slightly later on another server,
the lock from the first invocation has already been deleted,
and the task is executed for a second time.

This change relies on the DEFAULT_TTL constant to tidy-up locks rather than
doing so in this extension.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant