Yeah, it's been my experience that PyLucene and threads just don't work. I'm using spyce, not cherrypy, and spyce has an option to fork instead of using threads; if that's not an available option, another easy thing to do is to use XMLRPCServer to create a simple PyLucene server, run it separately, and make xmlrpc calls to it from cherrypy.
There's this old problem with native code libraries and threads causing seg faults... I don't know if there's any way around it. 2005/7/26, Rune Hansen <[EMAIL PROTECTED]>: > Hi, > I'm trying to move a PyLucene searcher that works when implemented in > mod_python to Cherrypy(svn498). Unfortunately all I've managed to get > so far is a Segmentation fault. The main difference is that > mod_python forks and Cherrypy uses threads, I guess that's what's > causing the Segfault. I've so far been completely unable to sneak in > a PyLucene.PythonThread anywhere in the code and make it work. > > Anyway, the Segfault seems to happen when a Cherrypy request thread > tries to create a FSDirectory.getDirectory(.. > > import os > os.environ['GCJ_PROPERTIES'] ="disableLuceneLocks=true" > import cherrypy > from PyLucene import * > class LuceneSeach(object): > def __init__(self,... > . > @cherrypy.expose > def index(self,.. > . > @cherrypy.expose > def search(self,indexpath,... > directory = PyLucene.FSDirectory.getDirectory(indexpath,False) > . > if __name__ == "__main__": > cherrypy.root = LuceneSearch() > cherrypy.config.update(.. > cherrypy.server.start() > > I'd appreciate any help or suggestions. > > best regards > /rune > > Happy those, who can remain at Highbury! > Jane Austen > > > _______________________________________________ > pylucene-dev mailing list > [email protected] > http://lists.osafoundation.org/mailman/listinfo/pylucene-dev > _______________________________________________ pylucene-dev mailing list [email protected] http://lists.osafoundation.org/mailman/listinfo/pylucene-dev
