Make cached_db backend resilient to cache backend errors
In the case storing the session data in the cache for the cached_db
backend is failing, this should not make the whole request crash.
Use case: you add a big content to messages.success
, bigger than what your configured cache backend can accept (e.g. obtaining a TooBig error with memcache). Then every future request from that session will crash.
I would suggest to log the failure instead of letting the cache backend exception crash the request, and continue with the request, as missing saving the session data in the cache is not a serious condition, it will only slow the requests a bit as the database will be hit each time until the issue is solved.
Change History
(10)
Triage Stage: |
Unreviewed → Accepted
|
Type: |
Bug → Cleanup/optimization
|
Owner: |
changed from nobody to Sulabh Katila
|
Status: |
new → assigned
|
Has patch: |
set
|
Needs documentation: |
set
|
Needs tests: |
set
|
Patch needs improvement: |
set
|
Needs tests: |
unset
|
Patch needs improvement: |
unset
|
Patch needs improvement: |
set
|
Patch needs improvement: |
unset
|
Needs documentation: |
unset
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
Thanks Claude for the report.
Following the description, I agree that it makes sense to not fail the whole request when the storing in the cache fails. I couldn't find an older ticket for this issue, so I'm accepting it, though it would be great if you could provide a reproducer or test case to aid future contributors.