-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Add a session backend to store session data in the database #21167
Conversation
38a3cc6
to
782de86
Compare
airflow/migrations/versions/c381b21cb7e4_add_session_table_to_db.py
Outdated
Show resolved
Hide resolved
0017000
to
34245ed
Compare
We need to add it to NOTICE as well. |
cc6b1ad
to
ad88d10
Compare
@@ -23,7 +23,9 @@ Here's the list of all the Database Migrations that are executed via when you ru | |||
+--------------------------------+------------------+-----------------+---------------------------------------------------------------------------------------+ | |||
| Revision ID | Revises ID | Airflow Version | Description | | |||
+--------------------------------+------------------+-----------------+---------------------------------------------------------------------------------------+ | |||
| ``e655c0453f75`` (head) | ``587bdf053233`` | ``2.3.0`` | Add ``map_index`` column to TaskInstance to identify task-mapping, and a ``task_map`` | | |||
| ``c381b21cb7e4`` (head) | ``e655c0453f75`` | ``2.3.0`` | Create a ``sessions`` table to store web session data | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to be moved into the right spot for 2.2.4 (e.g. a different "revises id"), but I'm most likely going to pull another revision back to 2.2.4 tomorrow so hold off for now. At least this comment will remind us we need to do it.
@jedcunningham Some of the code your wanted changes to is the vendored in code. I intentionally made as minimal modifications to that code as I needed, with the intent to possibly make a PR to upstream Flask-Session, get that merged, and migrate to using that (and removing our vendored code). The more and more in-depth modifications we make to the vendored code, the more difficult it will be to switch in the future. I'm happy to make the changes you noted if you'd still like me to (please let me know), I just wanted to bring that to your attention first. |
1d40916
to
8ced244
Compare
On this topic, thinking out loud... If we're trying to be able to easily understand what changes we've made to the vendored code, should we merge it in first with no changes? then make PRs on top of that which modify its behavior? Alternatively I don't think we do submodules 'round here but is this a valid case for it? |
In a case or two previous to this we have merged the PR without squashing (manually on the command line). |
@dstandish That's a good call, but it's looking less and less likely that our changes are going to be palatable to the maintainer of Flask-Session. If the changes we need won't ever be merged into Flask-Session, then our modified vendored code just becomes...our code, with an additional copyright line/header. A "middle path" of this would be to start maintaining our own fork of Flask-Session, merge in the changes that we need, maybe merge in a few more unmerged PRs from Flask-Session, and have our fork become the friendlier (than Flask-Session) session package for Flask. But I don't want to sign the company up for that responsibility without some consensus and blessing, and I don't really want to maintain my own personal fork of Flask-Session specifically for Airflow. I'm happy to do whatever it takes to get this merged, but I will need some guidance on how to get there. |
35937be
to
ef3fa62
Compare
ef3fa62
to
283f0d4
Compare
283f0d4
to
d4e2540
Compare
Superseded by #21478. |
This PR re-implements modified portions of Flask-Session to store session data in the database.
Things to note:
TODO:
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.