Maybe I'm missing something obvious but why Magento is storing database locks in a file system?

Storing them in a database instead will make it faster and will also resolve the clustering issue.

Any ideas?

  • for you to be able to clear them manually perhaps? – Julien Lachal Jul 23 '14 at 14:43
  • @JulienLachal I can clean anything manually, not just filesystem. – user487772 Jul 23 '14 at 15:17

Normally you would use a lock when running scripts from the CLI. The only reason I can think of is that a file lock is released in case your script unexpectedly dies. This won't happen if you use a DB lock: you would have to manually release the lock.

  • You can use destructor and/or shutdown to release locks. – user487772 Jun 18 '15 at 10:46

It's actually very good question.

One reason I can think of is that if you run database intense stuff (such as reindexing, which creates those locks), getting an answer from the database could take considerably more time than checking for a semaphore file.

  • Well, in this case I can store them in Redis/Memcached/whatever. – user487772 Jun 18 '15 at 10:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.