Jim Gallacher wrote:
Gregory (Grisha) Trubetskoy wrote:


Is this reproducable? With a 1 in 31 chance it should be pretty easy to reproduce... Just want to make sure that there isn't some undrelying reason why this was done this way.


The supposition that there is a deadlock is untested and simply based on inspecting the code. dharana was asking about using psp outside of apache, and when I took a look at psp.py I noticed the potential deadlock. I'll give it a whirl and see if I can lock up my server. :)

Confirmed and reproducable.

Using mpm-worker with 2 servers started, deadlock occurs within 10 to 50 requests based on 5 test runs

ab -n 100 http://localhost/mp/mptest.py.

Bad handler - deadlock
----------------------
def handler(def):
    req.content_type = 'text/plain'
    sess = Session.FileSession(req)
    template = psp.PSP(req, filename='/var/www/mp/template.psp')
    template.run({'what':'world'})
    return apache.OK

Good handler - no deadlock when session is unlocked
---------------------------------------------------
def handler(def):
    req.content_type = 'text/plain'
    sess = Session.FileSession(req)
    sess.unlock()
    template = psp.PSP(req, filename='/var/www/mp/template.psp')
    template.run({'what':'world'})
    return apache.OK

template.psp
------------
psp test
<%= what %>
End test

Jim

Reply via email to