Opened 18 years ago

Closed 18 years ago

Last modified 17 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

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

Download all attachments as: .zip

Change History (2)

by eugene@…, 18 years ago

Attachment: django.cache2.patch added

comment:1 by Adrian Holovaty, 18 years ago

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