Opened 13 years ago

Closed 13 years ago

Last modified 11 years ago

#1039 closed defect (fixed)

[patch] file cache blows up time to time

Reported by: eugene@… Owned by: Jacob
Component: Core (Cache system) Version:
Severity: normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I am getting weird errors ~once a week:

Traceback (most recent call last):

 File "/home/elazutkin/djsrc/django/core/handlers/", line 74, in get_response
   response = callback(request, *callback_args, **callback_kwargs)

 File "/home/elazutkin/djsrc/django/utils/", line 12, in _wrapped_view
   result = middleware.process_request(request)

 File "/home/elazutkin/djsrc/django/middleware/", line 40, in process_request
   cache_key = get_cache_key(request, self.key_prefix)

 File "/home/elazutkin/djsrc/django/utils/", line 125, in get_cache_key
   headerlist = cache.get(cache_key, None)

 File "/home/elazutkin/djsrc/django/core/", line 299, in get
   exp = pickle.load(f)


I have no idea how it happens. Maybe a processing thread dies when connection closes prematurely for whatever reason before it finished writing. I've added EOFError to the long list of allowable exceptions. Sometimes I feel we need to go back to the original implementation and treat all errors during cache retrieval as "no cached data".

Attachments (1)

django.cache2.patch (424 bytes) - added by eugene@… 13 years ago.

Download all attachments as: .zip

Change History (2)

Changed 13 years ago by eugene@…

Attachment: django.cache2.patch added

comment:1 Changed 13 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

(In [1685]) Fixed #1039 -- Changed file-based cache to cache EOFErrors during pickle. Thanks for the patch, Eugene

Note: See TracTickets for help on using tickets.
Back to Top