This is a topic that comes up occasionally, but since the symptom
seems to be rare and hard to provoke, it never gets resolved.
Well it's biting me again and I'm determined to fix it, but
would like some input from the list.

Related collector issues:

The issue:
On rare occasions I have seen ConflictErrors raised during
product installation.

Today, I can finally provoke them at will with a pretty minimal setup.

The setup:
Zope 2.7.3, using ZEO, with DirectoryStorage on the ZEO server.
Hardware:  dual-processor PIII 800, some kinda scsi disk, ext3, 
some old redhat flavor of linux.

To provoke it I need merely do
./bin/zopectl run

... where is empty.
Products/ now contains only one dummy product,
which I've named Conflictor, which contains only an empty
I get a ConflictError during registration of Conflictor.

Interestingly I can only provoke this ConflictError in this particular
INSTANCE_HOME.  I have several other instances and am not seeing the
symptom there.

I started trivially hacking OFS/ to add some debugging output
(a diff against 2.7.3 is attached), and here's what I get:

[EMAIL PROTECTED] PaulMiniInstanceHome]$ ls Products/
[EMAIL PROTECTED] PaulMiniInstanceHome]$ mkdir Products/Conflicter
[EMAIL PROTECTED] PaulMiniInstanceHome]$ touch Products/Conflicter/__in
[EMAIL PROTECTED] PaulMiniInstanceHome]$ touch
[EMAIL PROTECTED] PaulMiniInstanceHome]$ ./bin/zopectl run
installing product PluginIndexes...OK!
installing product Conflicter... BZZT
Traceback (most recent call last):
  File "<string>", line 1, in ?
  File "/usr/local/lib/python2.3/site-packages/PIL/", line 51, in app

  File "/usr/local/lib/python2.3/site-packages/PIL/", line 47, in 

  File "/zope/Zope-2.7.3-SoftwareHome/lib/python/Zope/App/", line 96,
in startup
  File "/zope/ZopeSoftwareHome/lib/python/OFS/", line 279, in init
  File "/zope/ZopeSoftwareHome/lib/python/OFS/", line 306, in init
  File "/zope/ZopeSoftwareHome/lib/python/OFS/", line 561, in inst
    return install_products(app)
  File "/zope/ZopeSoftwareHome/lib/python/OFS/", line 597, in inst
    folder_permissions, raise_exc=debug_mode)
  File "/zope/ZopeSoftwareHome/lib/python/OFS/", line 803, in inst
  File "/zope/Zope-2.7.3-SoftwareHome/lib/python/ZODB/", line 252,
 in commit
  File "/zope/Zope-2.7.3-SoftwareHome/lib/python/ZODB/", line 738,
in tpc_vote
  File "/zope/Zope-2.7.3-SoftwareHome/lib/python/ZEO/", line 841
, in tpc_vote
  File "/zope/Zope-2.7.3-SoftwareHome/lib/python/ZEO/", line 825
, in _check_serials
ZODB.POSException.ConflictError: database conflict error (serial this txn starte
d with 0x035b25f36751f988 2005-02-10 18:59:24.215675, serial currently committed
 0x035b743c6d186822 2005-02-24 17:00:25.569220)

I guess what I'm asking, before I hack more on OFS/,
is this:

* any ideas re. what on earth could be causing this ConflictError?
  the product doesn't DO anything fer chrissakes.
  (Maybe registration is finishing too fast??)

* Is the PIL stuff in the traceback a red herring or what?


Paul Winkler
*** Thu Feb 24 14:27:23 2005
---      Thu Feb 24 14:32:24 2005
*** 34,39 ****
--- 34,40 ----
  from Acquisition import aq_base
  from App.Product import doInstall
  from App.config import getConfiguration
+ from ZODB.POSException import ConflictError
  class Application(Globals.ApplicationDefaultPermissions,
                    ZDOM.Root, Folder.Folder,
*** 587,594 ****
          if done.has_key(product_name):
!         install_product(app, product_dir, product_name, meta_types,
!                         folder_permissions, raise_exc=debug_mode)
--- 588,606 ----
          if done.has_key(product_name):
!         # collector issue 300: handle ConflictErrors during installation
!         sys.stderr.write('installing product %s' % product_name)
!         try:
!             import time; time.sleep(0.1)
!             app._p_jar.sync()  # DM's suggestion
!             install_product(app, product_dir, product_name, meta_types,
!                             folder_permissions, raise_exc=debug_mode)
!             sys.stderr.write('...OK!\n')
!         except ConflictError:
!             # somehow we should retry it. XXX look at zpublisher
!             sys.stderr.write('... BZZT\n')
!             raise
Zope-Dev maillist  -
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to