#20620: CachedFileMixin.post_process breaks when cache size is exceeded
-------------------------------------+------------------------------------
     Reporter:  julians37@…          |                    Owner:  jcatalan
         Type:  Bug                  |                   Status:  assigned
    Component:  contrib.staticfiles  |                  Version:  1.5
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+------------------------------------

Comment (by dsanders11):

 IMO this bug could be closed, I don't believe it's a real issue. I've been
 in the relevant code a lot recently, and I think I can fairly confidently
 say there's no real way for this to happen unless other factors are in
 play, hence the difficulty reproducing. Even if there's a cache miss
 during post-processing, the worst that happens is the file is hashed again
 to get the result. You could run the post-processing with `MAX_ENTRIES` at
 1 and it should also still work.

 The hint of what went wrong here is in the error "ValueError: The file
 'foo' could not be found with
 <django.contrib.staticfiles.storage.CachedStaticFilesStorage object at
 0x94f654c>". If the file can't be found then it must have been moved or
 deleted during the post-processing. A cache miss during post-processing
 will perform the same as a cache miss when live, so if a cache miss during
 post-processing leads to a file can't be found error, that would happen to
 the live code if the cache got cleared.

 I think the root cause of this case was something modified the files
 during post-processing (perhaps a misguided effort to delete the original
 file after pre-processing to save disk space) and when the cache miss
 occurred the original file couldn't be found to hash again.

--
Ticket URL: <https://code.djangoproject.com/ticket/20620#comment:6>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/077.7b3c69e96dbcaf724d9e53635feeaa18%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to