[Zope-dev] Zope Server hanging :-(

richard@bizarsoftware.com.au richard@bizarsoftware.com.au
Wed, 06 Jun 2001 09:37:51 +1000


Dieter Maurer wrote:
> 
>  > Erik Enge wrote:
>  > > On Sun, 29 Apr 2001, Erik Enge wrote:
>  > > I figured it out, I think.  Let's say I have these two methods:
>  > >
>  > >  def a():
>  > >         b()
>  > >
>  > >  def b():
>  > >         a()
>  > >
>  > > If I call a(), then Zope dies and restarts without giving me any error
>  > > at all.  Anyone got a clue?
> This is an infinite recursion.
> 
> I once had such a situation.
> 
>    Usually Python protects itself against such recursions by limiting
>    the depth of its runtime stack. It raises a "RuntimeError: runtime
>    stack limit exceeded" when its stack overflows.
> 
>    But in my case, the thread's runtime stack (maintained
>    by the C runtime not Python) was more limited
>    than the Python stack limit. When the thread's stack overflew,
>    the process was killed by Solaris.
>    Python did not have any chance to raise an exception
>    as the death was immediate.
> 
> We may need to ask the Python maintainers to increase the
> thread stack size or to more severely restrict the
> Python runtime stack.

This can be done manually in your site.py - sys.setrecursionlimit()


     Richard

-- 
Richard Jones
richard@bizarsoftware.com.au
Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)