You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by "Graham Dumpleton (JIRA)" <ji...@apache.org> on 2006/06/27 13:03:29 UTC

[jira] Created: (MODPYTHON-175) PSP error page accessing session object can cause a deadlock.

PSP error page accessing session object can cause a deadlock.
-------------------------------------------------------------

         Key: MODPYTHON-175
         URL: http://issues.apache.org/jira/browse/MODPYTHON-175
     Project: mod_python
        Type: Bug

    Versions: 3.2.8    
    Reporter: Graham Dumpleton


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)


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (MODPYTHON-175) PSP error page accessing session object can cause a deadlock.

Posted by "Graham Dumpleton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MODPYTHON-175?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Graham Dumpleton closed MODPYTHON-175.
--------------------------------------


> PSP error page accessing session object can cause a deadlock.
> -------------------------------------------------------------
>
>                 Key: MODPYTHON-175
>                 URL: https://issues.apache.org/jira/browse/MODPYTHON-175
>             Project: mod_python
>          Issue Type: Bug
>    Affects Versions: 3.2.8
>            Reporter: Graham Dumpleton
>         Assigned To: Graham Dumpleton
>             Fix For: 3.3
>
>
> 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)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (MODPYTHON-175) PSP error page accessing session object can cause a deadlock.

Posted by "Graham Dumpleton (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/MODPYTHON-175?page=all ]

Graham Dumpleton resolved MODPYTHON-175.
----------------------------------------

    Fix Version/s: 3.3
       Resolution: Fixed

> PSP error page accessing session object can cause a deadlock.
> -------------------------------------------------------------
>
>                 Key: MODPYTHON-175
>                 URL: http://issues.apache.org/jira/browse/MODPYTHON-175
>             Project: mod_python
>          Issue Type: Bug
>    Affects Versions: 3.2.8
>            Reporter: Graham Dumpleton
>         Assigned To: Graham Dumpleton
>             Fix For: 3.3
>
>
> 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)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Work started: (MODPYTHON-175) PSP error page accessing session object can cause a deadlock.

Posted by "Graham Dumpleton (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/MODPYTHON-175?page=all ]

Work on MODPYTHON-175 started by Graham Dumpleton.

> PSP error page accessing session object can cause a deadlock.
> -------------------------------------------------------------
>
>                 Key: MODPYTHON-175
>                 URL: http://issues.apache.org/jira/browse/MODPYTHON-175
>             Project: mod_python
>          Issue Type: Bug
>    Affects Versions: 3.2.8
>            Reporter: Graham Dumpleton
>         Assigned To: Graham Dumpleton
>
> 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)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Assigned: (MODPYTHON-175) PSP error page accessing session object can cause a deadlock.

Posted by "Graham Dumpleton (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/MODPYTHON-175?page=all ]

Graham Dumpleton reassigned MODPYTHON-175:
------------------------------------------

    Assignee: Graham Dumpleton

> PSP error page accessing session object can cause a deadlock.
> -------------------------------------------------------------
>
>                 Key: MODPYTHON-175
>                 URL: http://issues.apache.org/jira/browse/MODPYTHON-175
>             Project: mod_python
>          Issue Type: Bug
>    Affects Versions: 3.2.8
>            Reporter: Graham Dumpleton
>         Assigned To: Graham Dumpleton
>
> 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)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira