Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Ticket #630 (defect)

Opened 2 years ago

Last modified 2 years ago

Implicit session locking before_request_body harms uploads

Status: closed (fixed)

Reported by: fumanchu Assigned to: fumanchu
Priority: normal Milestone: 3.1
Component: CherryPy code Keywords:
Cc:

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.

Change History

12/24/06 17:27:14: Modified by fumanchu

  • status changed from new to assigned.
  • description changed.

12/28/06 17:25:31: Modified by fumanchu

  • status changed from assigned to closed.
  • resolution set to fixed.

Fixed in [1579].

Hosted by WebFaction

Log in as guest/cpguest to create tickets