Uploaded image for project: 'mod_python'
  1. mod_python
  2. MODPYTHON-175

PSP error page accessing session object can cause a deadlock.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.8
    • 3.3.1
    • None
    • None

    Description

      If a session object is required for a PSP page, the session object will be created automatically with the session being locked at the same time, when PSP.run() is called. If an error page is generated by the session page it in turn will then be run. The problem is that the session lock is still held by the main page and thus if the error page itself tries to also access the session object, when the PSP.run() method of the error page is called, it will create a new instance of the session object which will result in a deadlock.

      In MODPYTHON-38, the suggested change was that when PSP.run() creates the session object that it assign it back to req.session. This change was not made, but if it was then when the error page was run, it would simply have inherited the session object which had already been created by the main page and a deadlock would not have ensued.

      Thus could should read as:

      session = None
      if "session" in code.co_names:
      if hasattr(req, 'session'):
      session = req.session
      else:
      req.session = session = Session.Session(req)

      Attachments

        Activity

          People

            grahamd Graham Phillip Dumpleton
            grahamd Graham Phillip Dumpleton
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: