lucene-pylucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neha Gupta <>
Subject Re: initVM() crash and
Date Tue, 16 Jun 2009 18:35:11 GMT
Aric's suggestion seems to have done the trick. I just added "from
web.wsgiserver import WorkerThread" and then did exactly as the code snippet
that Aric sent below.

- Neha

On Mon, Jun 15, 2009 at 3:27 PM, Aric Coady <> wrote:

> On Jun 15, 2009, at 12:12 PM, Neha Gupta wrote:
>> The problem am having is that when I send a few requests one after the
>> other
>> then the server crashes. I tried to put initVM() right after import lucene
>> statement at the top of the program but the crash still happens. I also
>> read
>> this post:
>> .<
>> >
>> The problem seems familiar to mine, however, am not sure where should I
>> put
>> initVM(). Should I also be calling env.attachCurrentThread() somewhere?
> initVM must be called exactly once, so at the top of the program is a fine
> place for it.  attachCurrentThread must be called at least once per thread.
>  It is idempotent (and fast), so you can put it at the top of your request
> handler.
> I prefer putting it in the threading code anyway, instead of cluttering the
> app.  My lupyne project has an example of that:  look for WorkerThread in
>  LuPyne uses cherrypy, and uses cherrypy's wsgiserver, so the code
> will translate.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message