Comments (5)
I believe this is an issue related to my specific production configuration, and not with django-balancer itself. Switching to PinningCookieMiddleware resolved the issue for my app. If anyone runs into this issue out in the wild, please reopen this issue so that I can look into it further.
from django-balancer.
I had this issue once yesterday shortly after restarting the application server. Could it be that the session data is being deleted or invalidated upon app shutdown? I'm using Django 1.4's signed_cookies session engine as the backend.
from django-balancer.
For the record, we're having this issue at Readability. It appears to be happening sporadically on things that explicitly have no session to start (Like curl, pingdom hits, etc).
We're going to try the Cookie middleware and see how that fares.
from django-balancer.
Thanks. Switching to the Cookie middleware also solved it for us, and is serviceable for our needs. Thanks for providing this library.
from django-balancer.
The reason this happens is because the order of the middleware is important.
During the request the Django session middleware must execute first in order to add the session object to the request.
Ensure that middleware is loaded in this order:
...
# SessionMiddleware must be before PinningSessionMiddleware
'django.contrib.sessions.middleware.SessionMiddleware',
# Pin DB reads to the master DB after write.
'balancer.middleware.PinningSessionMiddleware',
...
from django-balancer.
Related Issues (11)
- Slave connection not present
- Django 1.8 Support HOT 1
- Add Travis & Coveralls Support
- Can't do subqueries with queries on different DBs. HOT 4
- DatabaseError: canceling statement due to conflict with recovery HOT 1
- InterfaceError: connection already closed HOT 1
- Take DB downtime into account HOT 3
- RoundRobinRouter shuffles self.pool, which is a setting. HOT 2
- Querysets joins HOT 5
- Update pypi
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-balancer.