Currently Django's session middleware saves sessions unconditionally
in process_response. I have created a patch which skips session save
on 500 responses. Reasons for this:
 1. When saving the session after PostgreSQL query error into database
backed session store, the save is guaranteed to fail due to aborted
transaction error. The save error will mask the original error.
 2. The session.save() will be cancelled by transaction middleware if
that is installed.
 3. Saving the session in 500 situations can be argued to be non-
wanted behaviour. The request processing likely ended due to
unexpected error. If so, it is also possible that the changes to
session aren't valid, or are incomplete.

Now, this is clearly a change to existing behaviour. Should this be
considered backwards incompatible or is this change not wanted at all?
If that is the case I will create a patch targeting #1 above
specifically.

 - Anssi

Ticket: https://code.djangoproject.com/ticket/3881
Patch: https://github.com/akaariai/django/tree/ticket_3881

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to