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

Server-side HTTP session configuration #22

Closed
Sparrow0hawk opened this issue Oct 12, 2023 · 1 comment
Closed

Server-side HTTP session configuration #22

Sparrow0hawk opened this issue Oct 12, 2023 · 1 comment
Assignees
Labels
5sp 5 story points technical Technical issue
Milestone

Comments

@Sparrow0hawk
Copy link
Contributor

Migrating to server side sessions was complicated by Cloud Run behaviours (4924f09).

In our initial configuration we used a filesystem backend for Flask-Session to manage server side sessions. However in Cloud Run the compute resources time out quickly meanining that the filesystem session data is lost and leading to internal server errors. For now these changes have been revoked but in future we'd like to return to this, potentially looking at an alternate backend (https://flask-session.readthedocs.io/en/latest/interfaces.html).

@Sparrow0hawk Sparrow0hawk added the technical Technical issue label Oct 12, 2023
@markhobson
Copy link
Contributor

Moved the original commit that switches to file-based HTTP sessions (4e9d610) to a new branch gh-22 for now. It's likely that we'll use this as a basis to switch to a database-based HTTP sessions in future.

@markhobson markhobson changed the title Server side session configuration Server-side HTTP session configuration Oct 12, 2023
@Sparrow0hawk Sparrow0hawk added this to the 1.0.0 milestone Jan 24, 2024
@markhobson markhobson added the 5sp 5 story points label Feb 21, 2024
@markhobson markhobson modified the milestones: 1.0.0, 0.13.0 Mar 13, 2024
@markhobson markhobson removed this from the 0.13.0 milestone Mar 21, 2024
@Sparrow0hawk Sparrow0hawk modified the milestones: 0.16.0, Private Beta May 1, 2024
@markhobson markhobson modified the milestones: Private Beta, 0.17.0 May 15, 2024
markhobson added a commit that referenced this issue May 23, 2024
Switches from Flask's default client-side cookie-based HTTP session to
Flask-Session's SQLAlchemy storage backend.

Caveat: Works fine with PostgreSQL, but intermittent SQLAlchemy errors with
SQLite. Needs more work but important to ship now.
markhobson added a commit that referenced this issue May 30, 2024
Aside from the performance benefits, updating the current session's expiry date
in SQLite for simultaneous requests causes a concurrency issue writing to the
database.
markhobson added a commit that referenced this issue Jun 17, 2024
markhobson added a commit that referenced this issue Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5sp 5 story points technical Technical issue
Projects
None yet
Development

No branches or pull requests

2 participants