You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-dev@lucene.apache.org by Marcus <qw...@gmail.com> on 2011/04/14 21:02:21 UTC

pylucene in twistd app running as daemon

Hello:

in a previous post, a user expressed problems running pylucene in a twistd
app (running as a daemon)
I have similar issues.   I didn't see an answer in the postings.
Everything works fine when twistd runs in foreground mode (twistd
--nodaemon)

the trick would seem to be knowing where is the right place to run initVM.

anyone out there get this to work?

lucene 2.9.2
twisted 10.1

thanks,
Marcus

Re: pylucene in twistd app running as daemon

Posted by Marcus <qw...@gmail.com>.
thanks, the problem though is digging deep enough into twisted to sort out
how to implement that,
and whether that means using twistd's tac files to initialize the app would
have to be abandoned for something more custom
for now, I subprocess a twistd foreground process, and exit the parent
process and it all seems to work well enough

On Thu, Apr 14, 2011 at 2:05 PM, Andi Vajda <va...@apache.org> wrote:

>
> On Thu, 14 Apr 2011, Marcus wrote:
>
>  in a previous post, a user expressed problems running pylucene in a twistd
>> app (running as a daemon)
>> I have similar issues.   I didn't see an answer in the postings.
>> Everything works fine when twistd runs in foreground mode (twistd
>> --nodaemon)
>>
>> the trick would seem to be knowing where is the right place to run initVM.
>>
>
> initVM() _must_ be run from the main thread before calling anything
> involving the embedded JVM.
>
> env.attachCurrentThread() _must_ be run from any other thread before
> calling anything involving the embedded JVM.
>
> Andi..
>

Re: pylucene in twistd app running as daemon

Posted by Andi Vajda <va...@apache.org>.
On Thu, 14 Apr 2011, Marcus wrote:

> in a previous post, a user expressed problems running pylucene in a twistd
> app (running as a daemon)
> I have similar issues.   I didn't see an answer in the postings.
> Everything works fine when twistd runs in foreground mode (twistd
> --nodaemon)
>
> the trick would seem to be knowing where is the right place to run initVM.

initVM() _must_ be run from the main thread before calling anything 
involving the embedded JVM.

env.attachCurrentThread() _must_ be run from any other thread before calling 
anything involving the embedded JVM.

Andi..