Hi Andi,
Thanks. I should've remembered this from my last interaction with PyLucene threads. Wasn't hard to replace threading.Thread in Cherrypy WSGIServer to get a "working" PythonThread server. However my old _friend_ GC Warning: Out of Memory! Returning NIL! has reared it's ugly head. If my memory serves me correctly(I' ve cheated and looked at my earlier posts to the list), I had this exact problem the last time I worked with PyLucene threads. Is this error to be expected? I'm running the searcher on RHES3.x Linux with the pre-built PyLucene 1.0 binaries. Last time I tried I never got Linux working, but OS X worked like a charm.

best regards
/rune





On 26. jul. 2005, at 22.01, Andi Vajda wrote:


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


Happy those, who can remain at Highbury!
Jane Austen (1775-1817)


_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

Reply via email to