On Wed, Sep 27, 2006 at 09:18:09AM -0400, Matthew Caron wrote: > > The process_task method makes use of get_lock and release_lock under MySQL. > > Unfortunately, these are not transaction safe. It is possible that the > > getmail process failed, aborting the transaction, and leaving the lock open. > > As Zope does connection pooling with ZMySQLDA, this will hold the lock > > indefinitely, until that connection is reset. > > That might explain why it starts working again when I restart zope. > > > If you wanted to submit a patch for an alternative locking mechanism for > > MySQL 5, that would be appreciated. For now, if you raise a bug on sf it > > will be looked at, but I cannot see an immediate fix to this issue. > > Why do the locking in the DB in the first place? Assuming that the > purpose of the lock is to be sure that two copies of the script don't > run, why not just create a lockfile somplace (/var? /tmp? something > configurable?) and use it via std. lockfile semantics?
The main reason is that there is no guarantee there is one MailManager instance per database backend, or that they are on the same server. > Alternatively, you can just wrap the body of the script in a big > exception handler (assuming Python has such a thing) which starts just > after you get the lock and ends just before you release the lock. That > way, you can be assured that the lock will get released. That is certainly an option, and if there was a patch submitted with relevant details and updates to test cases, it should be included in the core product. Regards, Kevin -- Kevin Campbell Logicalware Ltd GPG Key: F480EC23 ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Mailmanager-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mailmanager-users
