Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix explicitly releasing FileSessions #1834

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Dec 14, 2019

  1. Create a test to replicate falure. Ref cherrypy#1345

    Added a test that captures the failure when explicit session locking is
    used with file sessions.  The session tool adds a before_finalize hook
    to save the session, the FileSession class asserts that the session is
    locked before saving the session.  The end result is if you use
    explicit locking with file sessions and release the lock yourself an
    AssertionError is raised when before_finalize runs.
    dj51d committed Dec 14, 2019
    Configuration menu
    Copy the full SHA
    6a1d80f View commit details
    Browse the repository at this point in the history

Commits on Dec 15, 2019

  1. Fix AssertionError with explicit session locking

    Fix the AssertionError that is raised when using explicit locking with
    the FileSession storage class.  The before_finalize handler from the
    SessionTool calls save() on the session, which asserts that the session
    is locked, which may not be the case when using explicit locking.  If
    explicit locking is being used FileSession's _save() will now acquire
    the lock if the session is not already locked.
    
    Fixes cherrypy#1345
    dj51d committed Dec 15, 2019
    Configuration menu
    Copy the full SHA
    7b0e7d8 View commit details
    Browse the repository at this point in the history