问题
My site's zope log reports a number of conflict errors. Average of 120 per day of which 2-3 are unresolved. I've come across many articles on why conflict errors occur but nothing has been clear.
Most of these conflict errors occur on pages which run select queries on MySQL database. It is said that the number of conflict errors rise with an increase in concurrency of http requests because one ZODB object is created and the other tries to write to it. (I could not understand why and how ZODB objects are modified. Can anyone explain this ?)
But even when there is only one user using it, there are conflict errors raised. This generally happens when the website is accessed for the first time after an overnight restart of Zope.
What I've noticed that during some instances, trying to load a page which involves running a select query against a table raises a conflict error if the table is modified at the same time because of some other activity on the website.
All of this has to do with the ZODB object stuff. It should be storing the data from the table as an object or something. The original data is changed and hence the conflict. Am I correct ?
The website uses Zope 2.12.19 with Zope's built-in session manager and Python 2.6.8
A sample of the log file is below:
2014-03-26T12:31:27 INFO ZPublisher.Conflict ConflictError at /VirtualHostBase/https/xyz.com:443/ESA/VirtualHostRoot/test: database conflict error (oid 0x04a6, class BTrees.OOBTree.OOBTree, serial this txn started with 0x03a5bd4f6e81a2bb 2014-03-26 12:31:25.899935, serial currently committed 0x03a5bd4f73e1e833 2014-03-26 1`2:31:27.159949) (115 conflicts (3 unresolved) since startup at Wed Mar 26 00:01:06 2014)
来源:https://stackoverflow.com/questions/22661373/zope-conflict-errors