#8616: Session file corrupted with SESSION_SAVE_EVERY_REQUEST = True -------------------------------------+-------------------------------------- Reporter: [EMAIL PROTECTED] | Owner: nobody Status: new | Milestone: 1.0 Component: django.contrib.sessions | Version: SVN Keywords: session, file, race | Stage: Unreviewed Has_patch: 1 | -------------------------------------+-------------------------------------- When using django.contrib.sessions.backends.file with SESSION_SAVE_EVERY_REQUEST = True, repeated requests for the same session that arrive very close together will cause corruption in the session file and result in a dropped session. The recent changes in the session framework went a long ways in resolving this issue, but not quite far enough.
To resolve the problem, I tried using django.core.files.locks to lock the file when open for reading or writing. However, this proved not sufficiently atomic. The problem can be resolved using the atomic file locking flags when opening the session file for reading or writing. Unfortunately, these are not available on all platforms. The attached patch uses them if they are available. This fixes the problem on platforms that support the atomic file locking flags. -- Ticket URL: <http://code.djangoproject.com/ticket/8616> Django Code <http://code.djangoproject.com/> The web framework for perfectionists with deadlines --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" 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-updates?hl=en -~----------~----~----~----~------~----~------~--~---
