Closed kilianm closed 8 months ago
The heart of this issue is fixed in flask https://github.com/pallets/flask/pull/2254.
Regarding handling in flask-session, I think it is better to use SESSION_REDIS = Redis(host='localhost', port=6379, retry=retry, retry_on_error=[BusyLoadingError, ConnectionError, TimeoutError])
Redis exceptions on open_session make Flask crash painfully, not popping the context correctly (leaking data across requests). Flask doesn't catch any possible exceptions on the session_interface, resulting in messing up the context.
To reproduce
Fix Ideally Flask uses its interfaces safely - always popping context. Bug created: https://github.com/pallets/flask/issues/2517 Still, I think it would be nice that Flask-Session is safe as well, catching possible redis problems and not letting Flask deal with the exceptions.
Environment Python version: 2.7.6 Flask version: 0.10.1 Werkzeug version: 0.11.11 Flask-Session: 0.3.1