[Xapian-tickets] [Xapian] #185: Deadlocks with apache mod_python and mod_wsgi

Xapian nobody at xapian.org
Thu Jul 17 11:05:35 BST 2008


#185: Deadlocks with apache mod_python and mod_wsgi
-----------------------------+----------------------------------------------
 Reporter:  richard          |        Owner:  richard 
     Type:  defect           |       Status:  assigned
 Priority:  normal           |    Milestone:          
Component:  Xapian-bindings  |      Version:  SVN HEAD
 Severity:  normal           |   Resolution:          
 Keywords:                   |    Blockedby:          
 Platform:  All              |     Blocking:          
-----------------------------+----------------------------------------------

Comment(by grahamd):

 Note, Xapian definitely should work with mod_wsgi provided that you
 delegate web application code making use of Xapian to run in first
 interpreter. Thus try using:

   WSGIApplicationGroup %{GLOBAL}

 This should be the case even if Xapian performs callbacks into Python code
 whereby it needs to reacquire the Python GIL. It should all work because
 mod_wsgi specifically detects case where code is running in first
 interpreter and itself uses simplified Python GIL API in order to be
 compatible with other Python modules that use it.

 Note that mod_python (up to 3.3.1, regardless of Python version) is
 however broken and does not use simplified Python GIL API even when code
 executing in first interpreter. Thus, the suggestion of setting
 interpreter as 'main_interpreter' when using mod_python would definitely
 not work and lock ups would be seen if callbacks into Python from C code
 are occurring. If people are suggesting that it is working, they can't be
 using that feature of Xapian or have not compiled the SWIG bindings with
 thread support.

 In order for mod_python to work properly, as detailed in:

   http://issues.apache.org/jira/browse/MODPYTHON-217

 it must be fixed to use simplified Python GIL API for first interpreter.
 Even with fix, 'main_interprerter' would still need to be used.

 In summary, mod_wsgi works as long as first interpreter, use it if you are
 hosting a WSGI capable application. The mod_python package is however
 completely broken for the callbacks case, so avoid it if you can.

 I am getting sufficiently annoyed about the misinformation I am seeing on
 some forums about this, that it may be time to fix mod_python finally.
 Although, still recommend you just use mod_wsgi instead. :-)

-- 
Ticket URL: <http://trac.xapian.org/ticket/185#comment:23>
Xapian <http://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list