[mod_python] requests are blocking when using req.sendfile

Matt Barnicle mattb at wageslavery.org
Sat Sep 27 20:37:58 EDT 2008

> I haven't read this latest response, but have one guess al the
same. I
> will say first that working out what the problem has been has been
> made more difficult by you not offering up any source code for your
> handler to show exactly what you are doing.

ok.  i will try to offer more details when i post in the future. 
there is a lot of code involved in a single request, as it's an MVC
style framework, so i wasn't really sure what to post and didn't
want to flood my email with source code.  i will definitely be more
attentive to that however.

> Anyway, one viable explanation for the problem is that you are using
> mod_python session objects. Session objects are not normally unlocked
> until cleanup handler, which is after all response content has been
> returned. Thus if sending a lot of data back, requests from the same
> user will be locked out, as well as other users who are unfortunate
> enough to have the session keys fall into the same session mutex lock
> bucket.
> If you are using sessions, just before you return from handler, do
> something like:
>   req.session.save() # if necessary
>   req.session.unlock()
> I only say 'req.session' here as that is recommended convention for
> where you store it, you may well have it stored elsewhere.
> Graham

well, hallelujah!  i tried this, and it is in fact working!!!  i'm
ecstatic!  thank you so much for all your assistance.

- m@

More information about the Mod_python mailing list