[ZPatterns] excessive recursion error

joachim@beehive.de joachim@beehive.de
Tue, 3 Jul 2001 08:41:59 +0200 (CEST)


Hi Phil,

thanks for the quick answer (explanation). The script which caused the
problem, was actually a test script, which should test how many "records"
ZPatterns can handle. In the real application this is not used. But it also
shows up, when you try to reindex the Rack like this:

<dtml-in "getAllIds()">
<dtml-call "REQUEST.set('i',getItem(_['sequence-item']))">
<dtml-if "i">
<dtml-call "i.propertysheets.Basic.manage_changeProperties(isPrivate=i.isPrivate)">
</dtml-if>
</dtml-in>

If you replace

<dtml-call "i.propertysheets.Basic.manage_changeProperties(isPrivate=i.isPrivate)">

by:

<dtml-call "Catalog.uncatalog_object(_.string.join(i.getPhysicalPath(),'/'))">
<dtml-call "Catalog.catalog_object(i,_.string.join(i.getPhysicalPath(),'/'))">

there is no error. So is this the best method to reindex a Rack.

Also, if this is really a Zope bug, shall we report this to zope-dev ?

On Mon, 2 Jul 2001, Phillip J. Eby wrote:

> The problem is that the catalog is issuing a subtransaction commit, while a
> transaction commit is already taking place.  This commit attempt causes
> ZPatterns to try to catalog the objects again, leading to another attempt
> at subtransaction commit.  I presume it's happening sporadically because
> the catalog object has a _v_ attribute keeping count of how many things
> have been cataloged, and it's not reset between transactions, so as long as
> the catalog stays in cache, the count keeps going up...  and so it commits
> when the count gets there.
>
> This looks like it might be two Zope bugs: first, transactions should
> refuse to commit while they're already committing, and second, ZCatalog
> should not maintain its subtransaction threshhold count across transactions.
>


>
> At 04:08 PM 7/2/01 +0200, joachim@beehive.de wrote:
> >
> >Now sporadically I get this
> >
> ><P>
> >  <STRONG>Error Type: SystemError</STRONG><BR>
> >  <STRONG>Error Value: Excessive recursion</STRONG><BR>
> ></P>
> >
> >Traceback (innermost last):
> >  File /usr/local/Zope-2.2.1-src/lib/python/ZPublisher/Publish.py, line
> 222, in publish_module
> >  File /usr/local/Zope-2.2.1-src/lib/python/ZPublisher/Publish.py, line
> 187, in publish
> >  File /usr/local/Zope-2.2.1-src/lib/python/Zope/__init__.py, line 221, in
> zpublisher_exception_hook
> >    (Object: ProviderContainer)
> >  File /usr/local/Zope-2.2.1-src/lib/python/ZPublisher/Publish.py, line
> 175, in publish
> >  File /usr/local/Zope-2.2.1-src/lib/python/Zope/__init__.py, line 235, in
> commit
> >  File /usr/local/Zope-2.2.1-src/lib/python/ZODB/Transaction.py, line 251,
> in commit
> >  File /usr/local/Zope-2.2.1/lib/python/Products/ZPatterns/Agents.py, line
> 91, in commit
> >    (Object: GTMixin)
> >  File /usr/local/Zope-2.2.1/lib/python/Products/ZPatterns/Agents.py, line
> 194, in _objectAdded
> >    (Object: GTMixin)
> >  File /usr/local/Zope-2.2.1/lib/python/Products/ZPatterns/Agents.py, line
> 240, in _notify
> >    (Object: GTMixin)
> >  File /usr/local/Zope-2.2.1/lib/python/Products/ZPatterns/Expressions.py,
> line 122, in eval
> >  File /usr/local/Zope-2.2.1-src/lib/python/DocumentTemplate/DT_Util.py,
> line 337, in eval
> >    (Object: Catalog . catalog_object ( self , _ . string . join ( self .
> getPhysicalPath ( ) , '/'  )  ))
> >    (Info: _)
> >  File &lt;string&gt;, line 0, in ?
> >  File /usr/local/Zope-2.2.1-src/lib/python/Products/ZCatalog/ZCatalog.py,
> line 383, in catalog_object
> >    (Object: Traversable)
> >  File /usr/local/Zope-2.2.1-src/lib/python/ZODB/Transaction.py, line 251,
> in commit
> >  File /usr/local/Zope-2.2.1/lib/python/Products/ZPatterns/Agents.py, line
> 91, in commit
> >    (Object: GTMixin)
> >  File /usr/local/Zope-2.2.1/lib/python/Products/ZPatterns/Agents.py, line
> 194, in _objectAdded
> >    (Object: GTMixin)
>
> >  File /usr/local/Zope-2.2.1/lib/python/Products/ZPatterns/Agents.py,
> line 240, in _notify
> >    (Object: GTMixin)
> >  File /usr/local/Zope-2.2.1/lib/python/Products/ZPatterns/Expressions.py,
> line 122, in eval
> >  File /usr/local/Zope-2.2.1-src/lib/python/DocumentTemplate/DT_Util.py,
> line 337, in eval
> >    (Object: Catalog . catalog_object ( self , _ . string . join ( self .
> getPhysicalPath ( ) , '/'  )  ))
> >    (Info: _)
> >
> >and so on. Sporadically means, I could add up to 400 instances then when
> >adding 400 - 800, I got this error. Then I had to restart Zope, listed the
> >items -> no items were added tried again to add 400 - 800, this time
> without error.
> >Then added 800 - 1200, again: the same error, no items added
> >Zope restartet, tried again 800 - 1200 --> no error
> >tried 1200 - 1600 --> no error
> >tried 1600 - 2000 --> no error
> >tried 2000 - 2400 --> error
> >
> >Can someone explain this ?
>
>

Mit freundlichen Grüßen

Joachim Schmitz

-----------------------------------------------------------------
beehive elektronische medien GmbH          http://home.beehive.de
-----------------------------------------------------------------