[Zope-dev] still segfaults, this time no ZMySQLDA

Leonardo Rochael Almeida leo@hiper.com.br
28 Feb 2002 16:51:50 -0300


On Thu, 2002-02-28 at 16:09, Leonardo Rochael Almeida wrote:
> On Thu, 2002-02-28 at 10:55, Matthew T. Kromer wrote:
> > 
> > On Wednesday, February 27, 2002, at 06:49 PM, Leonardo Rochael Almeida 
> > wrote:
> > 
> > > So, what should I try now?
> > >
> > 
> > Did -t 1 help?  If not, do you feel comfortable hooking up gdb  and 
> > getting a traceback?
> 
> Funny enough, running with -t 1 solved it.
> 
> /me starts looking sideways to ZMySQLDA again, since it's not the new
> beta version...
> 
> The performance, understandably, is not the greatest, but it's tolerable
> (where tolerable means the client hasn't complained yet).
> 
> I'll start looking at ways to recompile my python scripts using another
> ZEO Client. I think I'll catalog all of them (using a very small
> subtransaction threshould) and use a "REQUEST.write()" in a PyScript to
> list them.
> 

COOL!!

I found a kickass way to recompile all PythonScripts without bringing
down the machine and writing the least amount of code ever possible!

Short version:

Create a python script in Zope root that recompiles "context" and
catalog all python scripts using that as a metadata.

Long version:

put the following python script in your root:
=============
## Script (Python) "recompile"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
# recompile the thing
context.write(context.read())

# return something to waste catalog space :-)
from string import join
return "recompiled %s\n" % join(context.getPhysicalPath(),"/")
=============

Now put a ZCatalog in your root, call it anything, say, pyScripts. Go to
the "Indexex" tab and remove all indexes but the "path" index. Go back
and go to the "Metadata" tab; remove all metadata and insert "recompile"
and getPhysicalPath (this one is completely optional). Go to the
Advanced tab and set the subtransaction threshould to a number that
looks reasonable to you (low enough so as not to  crash your machine
:-). Go to the "Find Objects" tab, make sure that only "Script (Python)"
is selected (verify, especially, that "All types" isn't selected) and
click "Find and Catalog".

wait...

wait...

wait some more...

go get a coke or a coffee or something...

wait a little more...

When you see the result page, you know that your pythonScripts are
recompiled (of course it won't take that long unless you have an 800+MiB
Data.fs crammed full of python scripts :-)

Cheers, Leo

-- 
Ideas don't stay in some minds very long because they don't like
solitary confinement.