-
Notifications
You must be signed in to change notification settings - Fork 57
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
Updated to make thread-safe in Django. #39
Conversation
Thanks for the patch! I've removed some unrelated changes (whitespace changes, double import of logging, and the wrapper for session cleanup) and recommitted the changes to a new branch lexalink_fix. Can you please look it over? Also, the unit tests didn't seem to pass for me on this branch. Do they work for you? |
Hi, the changes look good, however I suspect that you could probably come up with a cleaner general-purpose solution since you understand the code inside and out .. whereas I was just trying to fix the problem for my particular case (and only for Django). I hadn't run your unit-test, but I have it running (and working) in a production system that has thousands of sessions per day. Sorry about that. I suspect that while the Dango application works fine, I probably broke the webapp implementation (SessionMiddleware) since I am now passing an extra parameter (current_session) into the my_start_response function. I am also returning an extra parameter (_current_session) from the call function in SessionMiddleware. I don't know anything about webapp since I do all my development in Django, so my solution is not gemerally applicable... sorry about that.. |
Ah, so it goes. I'll have to see if I can port it to webapp at some point. I'll leave your pull request open in the meantime. |
Hi! i try to use this patch, but it give me this error:
Any clue? Thanks a lot! |
The patch was only tested with django .. On Fri, Aug 9, 2013 at 1:13 AM, rfrp notifications@github.com wrote:
|
I'm using django and gae... |
Here is the version that I am using. You can also find it in the Lexalink project on github On Sun, Aug 11, 2013 at 8:21 PM, rfrp notifications@github.com wrote:
|
I found my error. I was using a config from one of the examples: https://github.com/dound/gae-sessions/blob/master/demo-with-google-logins/appengine_config.py Y eliminates this from my project and works perfect. |
This works with Django, but I did not test it with the webapp framework.
You can see a description of the problem that this addresses here: http://stackoverflow.com/questions/14167213/app-engine-django-interleaving-multiple-requests-interfering-in-gae-sessions