[Zope] External methods & persistance and thread safety

Dennis Allison allison@sumeru.stanford.EDU
Wed, 4 Jun 2003 11:32:32 -0700 (PDT)

I'm not doing anything particularly fancy--I have a number of users, each
with a sandbox workspace in the local file system, not exposed in Zope.
I manage through the web editing of the sandbox along with validation of
the XML that's input, a bit of spell checking, strange character checking,
and the like.  Everything works out of the user's private space.  Inputs 
are from CVS, commits are to CVS.

Most of the heavy lifting is done in External Methods rather than a
Product or by firing off a process and waiting for it to complete.
Given what I know about Zope scheduling (one thread at a time, GIU, etc) I
don't think it's threading--but it could be, particularly if there's
something strange in the SMP side of things.

Any thought on how to track down this heissenbug?  I've seen the effects
twice, but it always could be ascribed to user error.  The predecessor
system use ParsedXML and ran on a single processor system and occasionally
had similar problems which never got tracked down to a root cause.

On Wed, 4 Jun 2003, Paul Winkler wrote:

> On Wed, Jun 04, 2003 at 12:51:39AM -0700, Dennis Allison wrote:
> > I have a Zope that is being used for content development.  Much of the
> > content is maintained in the local file system (e.g. CVS, temporary files,
> > and the like).  Some of the operations can take a bit of time.  And I have
> > a number of folks banging on the system at the same time.
> > 
> > Much of the heavy lifiting is done by python external methods and calls to 
> > systems programs through the os.system() method.  It all works swimmingly 
> > but for a couple of instances of anomolous behavior--the wrong file
> > getting written, for example. It could be a program error, but I don't
> > think so.  I'm wondering if I am running afoul of some persistance or
> > threading problem.   
> I'm no thread guru, but that certainly sounds like a threading issue.  
> Hard to say without knowing your external method code, what system
> programs you run, what arguments you give them...  Can you give us
> some idea of what these external methods do?
> > (And to make things suitably complex, this is all
> > running on a dual processor machine.)
> i dunno if that matters - python never uses more than one CPU at a time
> due to the global interpreter lock.  OTOH, if you had two zope instances 
> using zeo... might be an issue.
> -- 
> Paul Winkler
> http://www.slinkp.com
> (random hero from isometric.spaceninja.com)