-
Notifications
You must be signed in to change notification settings - Fork 201
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
Move locking to PHP (and remove scheduler_cron.sh) #190
Comments
+1 |
Guess that's the end of #143 |
Actually, no it's not. I have actually been thinking about that while creating this issue. Here are my thoughts: I want to eliminate the extra bash layer for most users, but that doesn't mean that we couldn't have a wrapper script for something like the daemon mode. |
It's not unheard of to daemonize with PHP (PHPCI comes to mind). Thought I'm not sure it will behave the same, and using |
IMO a bash daemon would be better. Having used PHP for a daemon in a On Monday, 9 November 2015, Steve Robbins [email protected] wrote:
Robbie Averill |
FYI we have lock realization in Mage_Index_Model_Lock |
I have a scheduler branch that does per scheduled job locking as well. |
Ok, so it looks like using a bash script to prevent parallel execution wasn't a good idea to begin with. To summarize:
Also, Magento's default cron already does some per-scheduler-locking: |
Ok, I think I confused locking a specific schedule with locking a specific job (type). |
I've just discovered locking issue in scheduler_cron.sh in version 1.2.2: It would be good to switch from file locking based on file/folder existence to flock() which is releasing exclusive lock once process exits. This idea is already implemented in Mage_Index_Model_Lock in PHP, but I think it may be also implemented in bash as temporary solution inside scheduler_cron.sh. Sounds good? |
Hi @andrey-legayev, I like the idea of moving the locking logic inside PHP and even better if there's already a concept in the Magento core that we can use (if that makes sense). Cheers, |
Also see #176 |
(Extracted from one of my comments in #176)
Since the solely purpose of this bash script is to handle locking I'm wondering why we're not handling this inside PHP since we're calling our own shell/scheduler.php anyway at this point.
We'd eliminate some complexity and wouldn't have to deal with an extra layer.
If we decide do to this we should keep the scheduler_cron.sh around for a while to be backwards compatible while updating the instructions in the backend and the documentation.
The text was updated successfully, but these errors were encountered: