Opened 9 years ago

Closed 9 years ago

Last modified 8 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: UI/UX:

Description

I am getting weird errors ~once a week:

Traceback (most recent call last):

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

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

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

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

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

EOFError

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@… 9 years ago.

Download all attachments as: .zip

Change History (2)

Changed 9 years ago by eugene@…

comment:1 Changed 9 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(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