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

Ticket #563 (defect)

Opened 2 years ago

Last modified 2 years ago

session handling hangs server

Status: closed (fixed)

Reported by: guest Assigned to: fumanchu
Priority: normal Milestone:
Component: CherryPy code Keywords: session hang
Cc:

The following code hangs the CP 3.0 beta (SVN of 15-09-2006) server sporadically if session handling is enabled:

# ready for python 2.5
from __future__ import division, generators, nested_scopes

import sys, cherrypy, logging, ConfigParser, random, os, time, traceback
from cherrypy import HTTPRedirect

# web-interface
class WIRoot(object):
        #static = cherrypy.tools.staticdir.handler(section='static', root="/your/static/dir/", dir='.')

        def __init__(self):
                self.exposed = True

        def index(self):
                raise HTTPRedirect("/main")
        index.exposed = True

        def main(self):
                return '<html>Main</html>'
        main.exposed = True

if __name__ == '__main__':
        cherrypy.tree.mount(WIRoot())

        cpcfgfile = 'cherrypy.cfg'
        cherrypy.config.update(cpcfgfile)

        try:
                print("Initialized, starting CP server... ")
                cherrypy.server.quickstart()
                print("Starting CP engine... ")
                cherrypy.engine.start()
        except KeyboardInterrupt:
                print("Received keyboard interrupt, shutting down")
        except:
                raise


Change History

09/15/06 16:00:40: Modified by fumanchu

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

Apparently fixed in [1367]. If that *still* doesn't work in the future, switching from Semaphore to RLock will at least prevent the deadlock.

Hosted by WebFaction

Log in as guest/cpguest to create tickets