{"action":"created","issue":{"url":"https://api.github.com/repos/AOEpeople/Aoe_Scheduler/issues/190","labels_url":"https://api.github.com/repos/AOEpeople/Aoe_Scheduler/issues/190/labels{/name}","comments_url":"https://api.github.com/repos/AOEpeople/Aoe_Scheduler/issues/190/comments","events_url":"https://api.github.com/repos/AOEpeople/Aoe_Scheduler/issues/190/events","html_url":"https://github.com/AOEpeople/Aoe_Scheduler/issues/190","id":115710594,"number":190,"title":"Move locking to PHP (and remove scheduler_cron.sh)","user":{"login":"fbrnc","id":468820,"avatar_url":"https://avatars.githubusercontent.com/u/468820?v=3","gravatar_id":"","url":"https://api.github.com/users/fbrnc","html_url":"https://github.com/fbrnc","followers_url":"https://api.github.com/users/fbrnc/followers","following_url":"https://api.github.com/users/fbrnc/following{/other_user}","gists_url":"https://api.github.com/users/fbrnc/gists{/gist_id}","starred_url":"https://api.github.com/users/fbrnc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fbrnc/subscriptions","organizations_url":"https://api.github.com/users/fbrnc/orgs","repos_url":"https://api.github.com/users/fbrnc/repos","events_url":"https://api.github.com/users/fbrnc/events{/privacy}","received_events_url":"https://api.github.com/users/fbrnc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-08T05:37:32Z","updated_at":"2015-11-10T17:09:50Z","closed_at":null,"body":"(Extracted from one of my comments in #176)\r\n\r\nSince 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.\r\n\r\nWe'd eliminate some complexity and wouldn't have to deal with an extra layer.\r\nIf 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.\r\n"},"comment":{"url":"https://api.github.com/repos/AOEpeople/Aoe_Scheduler/issues/comments/155489772","html_url":"https://github.com/AOEpeople/Aoe_Scheduler/issues/190#issuecomment-155489772","issue_url":"https://api.github.com/repos/AOEpeople/Aoe_Scheduler/issues/190","id":155489772,"user":{"login":"fbrnc","id":468820,"avatar_url":"https://avatars.githubusercontent.com/u/468820?v=3","gravatar_id":"","url":"https://api.github.com/users/fbrnc","html_url":"https://github.com/fbrnc","followers_url":"https://api.github.com/users/fbrnc/followers","following_url":"https://api.github.com/users/fbrnc/following{/other_user}","gists_url":"https://api.github.com/users/fbrnc/gists{/gist_id}","starred_url":"https://api.github.com/users/fbrnc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fbrnc/subscriptions","organizations_url":"https://api.github.com/users/fbrnc/orgs","repos_url":"https://api.github.com/users/fbrnc/repos","events_url":"https://api.github.com/users/fbrnc/events{/privacy}","received_events_url":"https://api.github.com/users/fbrnc/received_events","type":"User","site_admin":false},"created_at":"2015-11-10T17:09:50Z","updated_at":"2015-11-10T17:09:50Z","body":"Ok, so it looks like using a bash script to prevent parallel execution wasn't a good idea to begin with. To summarize:\r\n- We should handle locking in PHP (and might use the mechanism Magento already provides with `Mage_Index_Model_Lock`)\r\n- We should handle locking only (?) on a schedule level and don't care about multiple php processes running at the same time (since the might finish early once they detect they have nothing to do since jobs are locked).\r\n\r\nAlso, Magento's default cron already does some per-scheduler-locking:\r\nhttps://github.com/OpenMage/magento-mirror/blob/magento-1.9/app/code/core/Mage/Cron/Model/Schedule.php#L216-L219\r\n@LeeSaferite: How's you approach different from that?"}}