1. cherrypy
  2. CherryPy
Issue #630 resolved

Implicit session locking before_request_body harms uploads

Robert Brewer
created an issue

From IRC today:

{{{ [14:06] *** now talking in #cherrypy [14:21] <noahz> I'm playing with cherrypy for the first time, and it seems like requests are blocking on the built-in server [14:22] <noahz> specifically, I'm trying to do some ajax calls on file-upload [14:23] <noahz> am I possibly doing something wrong, or is this a limitation of the server ? [14:32] <noahz> the json call should happen periodically, during the upload [14:32] <noahz> but it only happens right before and right after


[14:59] <noahz> hmm, I commented out all my settings on a whim and it seems to be doing better [15:00] <noahz> [global] [15:00] <noahz> server.socket_port = 8000 [15:00] <noahz> server.thread_pool = 10 [15:00] <noahz> tools.sessions.on = True [15:00] <noahz> is there anything wrong with that? [15:00] @fumanchu maybe the session is being locked throughout the upload [15:00] @fumanchu can you turn off the session tool just for the upload method? [15:01] @fumanchu (or use explicit locking) [15:02] @fumanchu tools.sessions.on = False -or- tools.sessions.locking = 'explicit' [15:02] <noahz> that's it! [15:04] <noahz> sessions on with locking = 'explicit' works well too [15:12] @fumanchu hm [15:13] @fumanchu maybe we should move implicit session locking from before_request_body to after }}}

I think moving sessions.init from {{{before_request_body}}} to {{{before_handler}}} (with a low priority so it runs early) would fix this nicely. The only question is whether other early tools need access to the session data.

Comments (3)

  1. Log in to comment