If you are using threads, you must use a PyLucene.PythonThread or else the process will crash really fast, as soon as libgcj allocates any memory, because the garbage collector won't know about the thread.

I don't know anything about Cherrypy but there is probably a way to rework its threading code to use PyLucene.PythonThread (a subclass of python's threading.Thread class).

Andi..

On Tue, 26 Jul 2005, Rune Hansen wrote:

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

Reply via email to