xappy causes deadlock with apache/mod_python

5 views
Skip to first unread message

nimrod

unread,
Jul 29, 2008, 7:59:50 AM7/29/08
to xappy-discuss
Hi,
I developed a xappy/xapian based app using django. While running on
the django dev server all is well, but when deploying with apache the
server goes into a deadlock (waiting for localhost...). When I remove
the "import xappy" line from my code it runs just fine.

Looking here: http://trac.xapian.org/ticket/185
It seems that I have to use:
PythonInterpreter main_interpreter
in my apache config file for using xapian. I tried that - no good
Looking some more I saw in the same report:
"Even with main_interpreter and Python >= 2.4, calling from Xapian's C+
+ code back to Python code won't work properly Even with
main_interpreter and Python >= 2.4 (this means that you can't subclass
Xapian objects in Python). "

I guess xappy is doing just that (i.e., subclassing xapian classes)
and thus is not usable with mod_python.

Help anyone?

Thanks
Nimrod

Graham Dumpleton

unread,
Jul 29, 2008, 8:37:03 AM7/29/08
to xappy-discuss
On basis that Django works on any WSGI server, as indicated in ticket
should work, can you try mod_wsgi instead. You still need to force use
of first interpreter as documented in ticket though.

I have changes for mod_python to fix it for main interpreter, but
haven't had a chance to tidy it up and commit it to mod_python
subversion repository.

Graham

nimrod

unread,
Jul 29, 2008, 10:33:07 AM7/29/08
to xappy-discuss
I compiled the new version of mod_wsgi, configured it, and it works!
I guess mod_wsgi is going to replace mod_python throughout our
production env
Thanks Graham!

On Jul 29, 3:37 pm, Graham Dumpleton <Graham.Dumple...@gmail.com>
wrote:

Graham Dumpleton

unread,
Jul 30, 2008, 8:37:58 PM7/30/08
to xappy-discuss


On Jul 30, 12:33 am, nimrod <nsteinb...@gmail.com> wrote:
> I compiled the new version ofmod_wsgi, configured it, and it works!
> I guessmod_wsgiis going to replace mod_python throughout our
> production env

In private email you said it didn't work with mod_wsgi 1.3. I don't
understand why you would have an issue with mod_wsgi 1.3 and not
mod_wsgi 2.1. The code that relates to simplified GIL state API is the
same in both versions.

If you can provide a really simple hello world example independent of
Django that demonstrates original problem that would help me, as could
do some testing of my own.

Thanks.

Graham

> Thanks Graham!
>
> On Jul 29, 3:37 pm, Graham Dumpleton <Graham.Dumple...@gmail.com>
> wrote:
>
> > On Jul 29, 9:59 pm, nimrod <nsteinb...@gmail.com> wrote:
>
> > > Hi,
> > > I developed a xappy/xapian based app using django. While running on
> > > the django dev server all is well, but when deploying with apache the
> > > server goes into a deadlock (waiting for localhost...). When I remove
> > > the "import xappy" line from my code it runs just fine.
>
> > > Looking here:http://trac.xapian.org/ticket/185
> > > It seems that I have to use:
> > > PythonInterpreter main_interpreter
> > > in my apache config file for using xapian. I tried that - no good
> > > Looking some more I saw in the same report:
> > > "Even with main_interpreter and Python >= 2.4, calling from Xapian's C+
> > > + code back to Python code won't work properly Even with
> > > main_interpreter and Python >= 2.4 (this means that you can't subclass
> > > Xapian objects in Python). "
>
> > > I guess xappy is doing just that (i.e., subclassing xapian classes)
> > > and thus is not usable with mod_python.
>
> > > Help anyone?
>
> > On basis that Django works on any WSGI server, as indicated in ticket
> > should work, can you trymod_wsgiinstead. You still need to force use

Richard Boulton

unread,
Jul 31, 2008, 4:41:32 AM7/31/08
to xappy-...@googlegroups.com
Graham Dumpleton wrote:
> If you can provide a really simple hello world example independent of
> Django that demonstrates original problem that would help me, as could
> do some testing of my own.

That would also be most interesting to me, since I'd like to understand
why I havn't been able to reproduce the reported problems with even
mod_python...

--
Richard

nimrod

unread,
Jul 31, 2008, 6:26:46 AM7/31/08
to xappy-discuss
Well, even just putting:
import xappy
caused apache to get stuck
I used mod_wsgi 1.3 as it came from the ubuntu repo but had to compile
mod_wsgi 2.1 myself. Maybe that made the difference.


On Jul 31, 11:41 am, Richard Boulton <rich...@lemurconsulting.com>
wrote:

emilmont

unread,
Aug 16, 2008, 8:11:36 PM8/16/08
to xappy-discuss
Xapian deadlocks with apache mod_python and mod_wsgi:
http://trac.xapian.org/ticket/185
Reply all
Reply to author
Forward
0 new messages