You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The title is truth for current release of Koyomi (v0.4.1 at June 6th, 2015).
Currently, when using MySQL datastore, we avoid coincident execution of jobs in the following way:
Update the semaphores record corresponding to the job when first worker executes it.
When second or third worker tries to execute the job, they check the semaphores record at first. And they know first worker now executed the job, then quit.
In addition, when several workers execute the same job on exactly same time, each of them run a transaction with optimistic lock on updating the semaphores record.
As a result, only one worker can get the lock and execute the job.
In this way, we can avoid coincident execution of jobs.
On the other hand, if one job takes longer time than its interval, the next job is to be started again before the previous job ends. So the same jobs can run concurrently.
Introducing "semaphore" or "mutex", we can avoid this concurrent execution of jobs.
I think it would be nicer than current implementation.
But if some of you don't like "semaphore" or "mutex", maybe I will make it optional so that you could opt it out.
Any feedback is welcome.
Thanks,
The text was updated successfully, but these errors were encountered:
The title is truth for current release of Koyomi (v0.4.1 at June 6th, 2015).
Currently, when using MySQL datastore, we avoid coincident execution of jobs in the following way:
In addition, when several workers execute the same job on exactly same time, each of them run a transaction with optimistic lock on updating the semaphores record.
As a result, only one worker can get the lock and execute the job.
In this way, we can avoid coincident execution of jobs.
On the other hand, if one job takes longer time than its interval, the next job is to be started again before the previous job ends. So the same jobs can run concurrently.
Introducing "semaphore" or "mutex", we can avoid this concurrent execution of jobs.
I think it would be nicer than current implementation.
But if some of you don't like "semaphore" or "mutex", maybe I will make it optional so that you could opt it out.
Any feedback is welcome.
Thanks,
The text was updated successfully, but these errors were encountered: